How to do location /test/place?id=2
P.V.Anthony
anthony at mindmedia.com.sg
Fri Oct 18 04:12:02 UTC 2019
On 18/10/19 9:03 am, Patrick wrote:
> 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
> }
This looks cool. Thank you for sharing this solution.
I am using ispconfig web control that only allows changes in the server
block.
I think map block is only allowed outside the server block. Is there
some way of setting a variable in the server block so that I can use the
config you have shared below?
if ( $is_new_site ) {
rewrite ^ http://new.example.com/${uri}?${args}? last;
}
P.V.Anthony
More information about the nginx
mailing list