Here is my situation.
I wrote a nginx module. one step is to send a subrequest to download a file from an external site like this.
ngx_http_subrequest(r, &(ctx->uri), &(ctx->uri_parameter), &sr, NULL, 0);
the uri above looks like this /aliyun_download/testbalabalabala.pdf the url_parameter looks like this. The parameter is url encoded
OSSAccessKeyId=dCPhhptMqGgftrD5&Signature=Hiu%2F67oTrNATZXhvwmH1dphEyjE%3D&Expires=1402323454
The nginx config I wrote looks like this
location /aliyun_download/ {
proxy_pass http://dev-data-primary.aliyuncs.com/;
}
But the problem I have is that the url which I use to download the file is url encoded, but it seems that nginx automatically decoded the url during proxy and send the un-encoded url to the external server. Since the external server is expecting the encoded url, it returns errors.
Can some nginx expert help me figure out how exactly I can solve this problem or correctly configure the nginx.
Thanks a lot!