On 18/10/19 12:20 pm, Patrick wrote:

Without a map, try starting with:

if ( $uri?$args = /test/place?id=2 ) {
     rewrite ^ http://new.example.com/${uri}?${args}? last;
}

Then as the site migration continues turn that `if' test into a regexp
that will match the migrated components.

I can get the following to work.

if ( $uri = /test/place ) {
      rewrite ^ http://new.example.com${uri}?${args}? last;
}

and this also works.

if ( $args = id=2 ) {
      rewrite ^ http://new.example.com${uri}?${args}? last;
}

Unfortunately I cannot get the suggested solution to work. Did I miss some setting or quotes?

> if ( $uri?$args = /test/place?id=2 ) {
>      rewrite ^ http://new.example.com${uri}?${args}? last;
> }


Tried the following and it works but is it safe?

if ( $request_uri = "/test/place?id=2" ) {
      rewrite ^ http://new.example.com${uri}?${args}? last;
}

P.V.Anthony
_______________________________________________
nginx mailing list
[email protected]
http://mailman.nginx.org/mailman/listinfo/nginx

Reply via email to