I have nginx configuration like this:
map $request_uri $target {
/test1234 https://www.somedomain.com/new_url?source=stackoverflow$is_args$args;
}
map $request_uri $target_code {
/test1234 301;
}
server {
listen 80 default;
if ($target_code = 301) {
return 301 $target;
}
}
For
/test1234 it works but if I have /test1234?test=1 or any query string, then nginx doesn't match this redirect.
It must work for any parameters.
Is any way to set up wildcard for any query string?