Rewrite request url to match the query string and normalization

Jindan Zhou jindan at
Sun Nov 11 15:58:58 UTC 2018

I have a simple nginx forward proxy, configured as:

server {
     listen                         8000;
     resolver             ;
     location / {
         proxy_pass http://$host;
         proxy_set_header Host $host;

The client behind its isp firewall sends the request (per nginx log): GET

How do I transform the requested url to before it is
sent to the upstream?

I looked up many posts online, but I am still confused at:

   1. The online examples usually teach how you match the uri part, but my
   goal is to obtain the queried string only, i.e., everything after the
   equation mark"=",
   2. I have no idea how to decode the percentage coded symbols into
   normalized one.

Thanks for your input!

.--- .. -. -.. .- -.    --.. .... --- ..-
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the nginx mailing list