auth_request not passing query string
rsavignon
nginx-forum at forum.nginx.org
Tue May 11 20:17:24 UTC 2021
Hi All, i'm trying to configure a auth based static files server using
nginx, but its not working because, i suppose, the $request_uri is not being
forwarded to the auth endpoint. Does auth_request support relaying
$request_uri ? If someone could give a tip i would be very grateful.
server {
listen 443 ssl;
listen [::]:443 ssl;
ssl_certificate ....;
ssl_certificate_key ....;
root /path/to/static/html;
index index.html index.htm index.nginx-debian.html;
server_name ...;
location / {
auth_request /validate;
auth_request_set $auth_status $upstream_status;
try_files $uri $uri/ =404;
}
location /validate {
proxy_pass https://validation.mysite.com/validate/;
proxy_ssl_certificate ...;
proxy_ssl_certificate_key ...;
proxy_pass_request_headers on;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
proxy_set_header X-Original-URI $request_uri;
}
}
Thanks in advance.
Posted at Nginx Forum: https://forum.nginx.org/read.php?2,291486,291486#msg-291486
More information about the nginx
mailing list