Can anyone explain the flow of a request with auth_request? If auth_request passes it goes to localhost:9000 and if it fails goes to localhost:8000.
There are location blocks in the 3 server blocks. If auth_request passes does it use the location blocks from the main server block or localhost:9000? And if it fails does it use the location blocks from the main server block or localhost:8000?
location / {
auth_request /authrequest;
error_page 401 = @failed;
proxy_pass http://localhost:9000;
}
location @failed {
proxy_pass http://localhost:8000;
}