Skip to content

Commit

Permalink
Merge pull request #1618 from maxlaverse/fix_fullforwardedfor_with_us…
Browse files Browse the repository at this point in the history
…eproxy

Fix full XFF with PROXY
  • Loading branch information
aledbf authored Oct 28, 2017
2 parents 9d91572 + b85055a commit 2a9e1eb
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions rootfs/etc/nginx/template/nginx.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -214,8 +214,13 @@ http {
# We can't use $proxy_add_x_forwarded_for because the realip module
# replaces the remote_addr too soon
map $http_x_forwarded_for $full_x_forwarded_for {
{{ if $all.Cfg.UseProxyProtocol }}
default "$http_x_forwarded_for, $proxy_protocol_addr";
'' "$proxy_protocol_addr";
{{ else }}
default "$http_x_forwarded_for, $realip_remote_addr";
'' "$realip_remote_addr";
{{ end}}
}
{{ end }}

Expand Down

0 comments on commit 2a9e1eb

Please sign in to comment.