Why does adding a trailing slash to the Nginx path /api fix the 404 error when using auth_request?
I encountered a path matching issue while configuring Nginx to internally forward requests. When the path /api
does not have a trailing slash, the subrequest is successfully handled by the verify
controller and returns a response, but the success
controller does not receive any requests, resulting in a 404 error in the browser. Adding a trailing slash /api/
resolves the issue. Here is the relevant configuration: