When rewriting a url with the rewrite directive, is it possible to save the original url in a request header for the downstream handler?<div><br></div><div>Similar to the X-Rewrite-URL header built in to ISAPI rewrite.</div>
<div><div>Or in Apache, I can do it with something like:</div><div><div><br></div><div><div>#== Capture original uri and query string into environment variable so it can be put in a header</div><div>#== Match non-empty query string</div>
<div>RewriteCond %{QUERY_STRING} (^.+$)</div><div>RewriteRule (.*) $1 [E=x-rewrite-url:$1?%1]</div></div></div><div><br></div><div>If this is possible in nginx, how would I do it?</div><div><br></div><div>Thanks</div></div>