Rewriting uri as querystring using nginx?

Edho Arief edho at myconan.net
Thu Feb 23 07:10:33 UTC 2012


On 2012-02-23 12:45, junius wang wrote:
> How do I rewrite URIs of the form
>
> http://domain1/one/two?three=four
>
> to
>
> http://domain2?path=http%3A%2F%2Fdomain1%2Fone%2Ftwo%3Fthree%3Dfour
>

Perhaps something like this:

rewrite ^ http://domain2?path=http://domain1$request_uri$is_args$args 
permanent;

Not sure about the escapes though.



More information about the nginx mailing list