eprhz
eprhz

Reputation: 11

Nginx redirect according to parameters

I want to be able to do the following :

Go to site http://mynginxserver.com/site=www.stack.com?a=b

Nginx need to redirect me to the address is site =

Can it be possible ?

Thanks

Upvotes: 1

Views: 98

Answers (1)

Mohammad AbuShady
Mohammad AbuShady

Reputation: 42899

Try something like this, not sure if it would work, also not really sure if I need to escape the =

location ^~ /site\=(.*) {
  return 301 http://$1$is_args$query_string;
}

Upvotes: 2

Related Questions