I have a nginx location directive whose purpose is to "remove" the localization prefix from the URI for the proxy_pass directive.
For example, to make the URI http://example.com/en/lalala , use proxy_pass http://example.com/lalala
location ~ '^/(?<locale>[\w]{2})(/(?<rest>.*))?$' { ... proxy_pass http://example/$rest; ... }
Thus, the rest variable will be decoded when passed to directeve proxy_pass. This seems to be the expected behavior .
The problem is when my URI contains the encoded space %20 passed from the client
http://example.com/lala%20lala
nginx decodes the URI for
http:
I see this in my error.log.
Question: is it possible to use the encoded variable rest somehow because it is passed from the client? If I am doing something completely wrong, please suggest the right way.
Thanks.
source share