On 2019-10-18 01:01, P.V.Anthony wrote:
> Currently have the following url,
>
> https://old.example.com/test/place?id=1
> https://old.example.com/test/place?id=2
> https://old.example.com/test/place?id=3
>
> Need to redirect only id=2 to another url.
This looks like a gradual migration of content to a new server. Try
using `rewrite' instead of `return'?
map "$uri?$args" $is_new_site {
/test/place?id=2 1;
default 0;
}
server {
...
if ( $is_new_site ) {
rewrite ^ http://new.example.com/${uri}?${args}? last;
}
...
# all the locations go here
}
Patrick
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx