I have
location /secret {
proxy_pass http://127.0.0.1:9090;
proxy_redirect default;
proxy_http_version 1.1;
auth_request /auth;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-forwarded-For $remote_addr;
}
location = /auth {
proxy_pass http://service/auth;
proxy_set_header Host $host;
proxy_pass_request_body off;
proxy_set_header X-Original-URI $request_uri;
}
And when I goto http://server/secret it authenticates me fine
location /secret2 {
auth_request /auth;
root /var/data/static;
}
When I goto http://server/secret2 I get a 401. I am not sure why. It should automatically authenticate me.