I'm using Nginx and trying to redirect using proxy_pass to a URL that comes as a query string. I also want to avoid passing any other parameters to that URL.
This is the url I'm sending to the proxy: http://10.10.10.10/proxydownload?url=http://www.test.com/d/guid/download&session=123
This is what I have in the nginx.conf:
location /proxydownload {
proxy_pass $arg_url;
}
However, this is generating a 502 error, and I don't know why. According to the logs, $arg_url contains "http://www.test.com/d/guid/download", and that's the url I want to hit. I tried to hardcode the URL in proxy_pass and it worked:
location /proxydownload {
proxy_pass http://www.test.com/d/guid/download;
}
Is there's something incorrect on the way I use $arg_url?