Skip to content

Commit

Permalink
Adding changes for configuration
Browse files Browse the repository at this point in the history
Signed-off-by: Yashvi Jain <yashvi.jain@progress.com>
  • Loading branch information
Yashvi Jain committed Oct 9, 2024
1 parent 6db8ae6 commit 64903c0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
5 changes: 2 additions & 3 deletions api/config/load_balancer/config_request.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ func DefaultConfigRequest() *ConfigRequest {
c.V1.Sys.Ngx.Http.ProxyBufferSize = w.String("8k")
c.V1.Sys.Ngx.Http.ProxyBuffers = w.String("8 8k")
c.V1.Sys.Ngx.Http.ProxyBusyBuffersSize = w.String("16k")
c.V1.Sys.Ngx.Http.IncludeXForwardedFor = w.Bool(false)

c.V1.Sys.Ngx.Http.Ipv6Supported = w.Bool(ipV6Supported())
c.V1.Sys.StaticConfig.Products = []string{"automate"}
Expand Down Expand Up @@ -169,9 +170,7 @@ func (c *ConfigRequest) SetGlobalConfig(g *config.GlobalConfig) {
if logLevel := g.GetV1().GetLog().GetLevel().GetValue(); logLevel != "" {
c.V1.Sys.Log.Level.Value = config.GlobalLogLevelToNginxLevel(logLevel)
}
if xForwarded := g.GetV1().GetNginx().GetHttpIncludeXForwardedFor(); xForwarded != nil {
c.V1.Sys.Ngx.Http.IncludeXForwardedFor = xForwarded
}

}

// PrepareSystemConfig returns a system configuration that can be used
Expand Down
9 changes: 3 additions & 6 deletions components/automate-load-balancer/habitat/config/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -338,12 +338,9 @@ http {

location /nginx_status {
stub_status on;
set $x_forwarded_for "{{../cfg.ngx.http_include_x_forwarded_for}}";
{{#if ../cfg.ngx.http.enable_csp_header ~}}
access_log /var/log/nginx/access.log chef;
{{ ~else }}
access_log off;
{{/if ~}}
set $x_forwarded_for "{{../cfg.ngx.http.include_x_forwarded_for}}";
access_log off;

allow 127.0.0.1;
deny all;
}
Expand Down

0 comments on commit 64903c0

Please sign in to comment.