I am trying to figure out if it is possible to forward the request parameter from the original URL to the handler / service auth_request?
Users should be able to add an API token as a request parameter, for example:
https://example.com/api/user?token=237263864823674238476
And not through headeror cookie. Can I access a parameter tokenin an auth service in any way ? Or write a query parameter tokenin a custom header using NGINX?
Tried this so far:
location = /api/user {
auth_request /auth;
proxy_set_header X-auth-token-from-query $arg_token;
proxy_pass http://<url>;
}
/authThe endpoint does not receive the header X-auth-token-from-query, but after returning the 200upstream proxy receives the header.
source
share