Has anyone ever needed to use the auth_request module within Nginx Proxy Manager? Can you tell me if this configuration is correct?
location / {
deny all;
}
location /api/ {
allow all;
if ($arg_auth = "") {
return 403 "Access Denied: Missing auth parameter";
}
auth_request /_oauth2_token_introspection;
proxy_pass http://192.168.15.229:5000/api/;
}
location = /_oauth2_token_introspection {
internal;
proxy_method POST;
proxy_set_header Authorization "bearer SecretForOAuthServer";
proxy_set_header Content-Type "application/x-www-form-urlencoded";
proxy_set_body "token=$arg_auth &token_hint=access_token";
proxy_pass https://xxx.free.beeceptor.com;
}
In the browser, it returns a 500 error and doesn’t even reach the token validation API.
checked error log files and show only this: “[error] 1467#1467: *5327 auth request unexpected status: 502 while sending to client”
I tried several examples on the internet without success.
I need my backend to validate the token before forwarding the call to the api
Eduardo Almeida is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.