Enabling oauth2-proxy authentication via auth_request directive fails due to proxy_pass before include directive in server.location blocks #2486
-
Our Setup:
We believe the best setup is to use the nginx However, when we define auth_request in
I notice that the include of Are there any solutions here? Is there a way to reorder the dynamically generated location block perhaps? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
I've also attempted to configure a two nginx-proxy solution where I have I've been playing with re-writing the https://github.com/nginx-proxy/nginx-proxy/blob/main/nginx.tmpl template to allow me to rewrite the |
Beta Was this translation helpful? Give feedback.
-
I do not have experience with ngx_http_auth_request_module so maybe I am wrong but I read in the docs: You can do that per virtual host or as default Are you getting any output from nginx? If something is wrong with the generated config it should alert on the console. |
Beta Was this translation helpful? Give feedback.
-
I was implementing the same architecture and faced the same issue. My solution was to create
and
|
Beta Was this translation helpful? Give feedback.
I do not have experience with ngx_http_auth_request_module so maybe I am wrong but I read in the docs:
Context: http, server, location
So would it be an idea to include it in the
server
directive instead of thelocation
of your whoami vhost? That comes before location with theproxy_pass
.In the template that is: Line 872
You can do that per virtual host or as default
Are you getting any output from nginx? If something is wrong with the generated config it should alert on the console.
Try to start the container not detached but in foreground. Or fetch the logs
sudo docker logs nginx-proxy