I am trying to implement a simple custom redirect with nginx.
Incoming request:
http://localhost:8182/testredirect/?asd=456&aaa=ddd&trueurl=http://example.com/sdd?djdj=55
I would like to receive HTTP 302 redirect to http://example.com/sdd?djdj=55
. I.e forward to anything after trueurl
argument.
I try this:
location /testredirect/ {
rewrite "\&trueurl=(.*)$" $1 redirect;
}
But this does not seem to work. It returns error 404. Do I miss something?