Skip to content

Commit

Permalink
Merge pull request #16 from goblain/realip
Browse files Browse the repository at this point in the history
adds headers for X-Real-IP and X-Forwarded-*
  • Loading branch information
pleshakov committed Apr 16, 2016
2 parents d76838c + 6c1b0bf commit f8e60b3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions nginx-controller/nginx/ingress.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ server {
{{range $location := $server.Locations}}
location {{$location.Path}} {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Port $server_port;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://{{$location.Upstream.Name}};
}{{end}}
}{{end}}
5 changes: 5 additions & 0 deletions nginx-plus-controller/nginx/ingress.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ server {
{{range $location := $server.Locations}}
location {{$location.Path}} {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Port $server_port;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://{{$location.Upstream.Name}};
}{{end}}
}{{end}}

0 comments on commit f8e60b3

Please sign in to comment.