rewrite save original url

pandy nginx-forum at nginx.us
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
[code]
set $cleanuri $uri;
[/code]
which in turn i pass to the proxy via headers
[code]
proxy_set_header X-Rewrite-FullURI $request_uri;
proxy_set_header X-Rewrite-CleanURI $cleanuri;
[/code]

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

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,132694,140164#msg-140164




More information about the nginx mailing list