Merge pull request #2977 from aledbf/realip-auth

Pass real source IP address to auth request
This commit is contained in:
k8s-ci-robot 2018-08-23 09:29:30 -07:00 committed by GitHub
commit 332b3ad23d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -833,6 +833,12 @@ stream {
proxy_set_header X-Original-URL $scheme://$http_host$request_uri; proxy_set_header X-Original-URL $scheme://$http_host$request_uri;
proxy_set_header X-Original-Method $request_method; proxy_set_header X-Original-Method $request_method;
proxy_set_header X-Sent-From "nginx-ingress-controller"; proxy_set_header X-Sent-From "nginx-ingress-controller";
proxy_set_header X-Real-IP $the_real_ip;
{{ if and $all.Cfg.UseForwardedHeaders $all.Cfg.ComputeFullForwardedFor }}
proxy_set_header X-Forwarded-For $full_x_forwarded_for;
{{ else }}
proxy_set_header X-Forwarded-For $the_real_ip;
{{ end }}
{{ if $location.ExternalAuth.RequestRedirect }} {{ if $location.ExternalAuth.RequestRedirect }}
proxy_set_header X-Auth-Request-Redirect {{ $location.ExternalAuth.RequestRedirect }}; proxy_set_header X-Auth-Request-Redirect {{ $location.ExternalAuth.RequestRedirect }};