rewrite save original url

pandy nginx-forum at
Wed Oct 13 22:00:58 MSD 2010

I found a way. Never used "set" variables before... need to study nginx
more :P

Just before the rewrites i'm saving the original $uri to a variable
set $cleanuri $uri;
which in turn i pass to the proxy via headers
proxy_set_header X-Rewrite-FullURI $request_uri;
proxy_set_header X-Rewrite-CleanURI $cleanuri;

p.s: all my content rewrites are using "last";

Posted at Nginx Forum:,132694,140164#msg-140164

More information about the nginx mailing list