Skip to content

Commit

Permalink
Fix template mappings
Browse files Browse the repository at this point in the history
  • Loading branch information
aledbf committed Sep 26, 2017
1 parent d73edb8 commit 6ee2b72
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion controllers/nginx/pkg/template/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -706,5 +706,5 @@ func trustProxyProtocol(input interface{}) bool {
}

return conf.Cfg.RealClientFrom == "tcp-proxy" ||
(conf.Cfg.RealClientFrom == "auto" && !conf.Cfg.UseProxyProtocol)
(conf.Cfg.RealClientFrom == "auto" && conf.Cfg.UseProxyProtocol)
}
4 changes: 2 additions & 2 deletions controllers/nginx/rootfs/etc/nginx/template/nginx.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ http {
'' close;
}

{{ if (trustHTTPHeaders $cfg) }}
{{ if (trustHTTPHeaders $all) }}
# Trust HTTP X-Forwarded-* Headers, but use direct values if they're missing.
map {{ buildForwardedFor $cfg.ForwardedForHeader }} $the_real_ip {
# Get IP address from X-Forwarded-For HTTP header
Expand Down Expand Up @@ -391,7 +391,7 @@ http {

{{ template "CUSTOM_ERRORS" $all }}
}

{{ if $server.Alias }}
server {
server_name {{ $server.Alias }};
Expand Down

0 comments on commit 6ee2b72

Please sign in to comment.