Nginx add location details to URL when we stop decoding URL

malintha nginx-forum at
Fri Feb 13 06:07:15 UTC 2015

I am accessing a URL which has encode characters


   location /gateway/ {
    proxy_set_header X-Forwarded-Host $host;
    proxy_set_header X-Forwarded-Server $host;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header Host $http_host;
    proxy_read_timeout 5m;
    proxy_send_timeout 5m;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";
    proxy_http_version 1.1;

I added $request_uri at then end of the proxy_pass URL as I have to stop
decoding by nginx.

When I configure like this nginx resolve it to (stop decoding but incorrect
URL - adding /gateway/)


but When I remove $request_uri it resolve to correct URL (but with

How can I resolve this ?


Posted at Nginx Forum:,256639,256639#msg-256639

More information about the nginx mailing list