forward-auth: fix special character support for nginx (#1578)

This commit is contained in:
bobby 2020-11-12 10:10:57 -08:00 committed by GitHub
parent eb19d6e125
commit c199909032
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 17 additions and 10 deletions

View file

@ -37,7 +37,8 @@ server {
client_max_body_size 1m;
# Pass the extracted client certificate to the auth provider
set $target http://pomerium/verify?uri=$scheme://$http_host$request_uri;
set $target http://pomerium/verify?uri=$scheme://$http_host$request_uri&rd=$pass_access_scheme://$http_host$escaped_request_uri;
proxy_pass $target;
}
@ -45,7 +46,7 @@ server {
internal;
add_header Set-Cookie $auth_cookie;
return 302
https://fwdauth.localhost.pomerium.io/?uri=$scheme://$host$request_uri;
https://fwdauth.localhost.pomerium.io/?uri=$scheme://$host$request_uri&rd=$pass_access_scheme://$http_host$escaped_request_uri;
}
location / {

View file

@ -19,6 +19,8 @@ proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "";
set_escape_uri $escaped_request_uri $request_uri;
# proxy_set_header X-Request-ID $req_id;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;