Redirect to a different url based on a query.

Geo P.C. pcgeopc at
Thu Sep 18 14:04:32 UTC 2014

We have a wordpress installation and need to redirect lost password link to
another different url for this we trying to setup a redirect rule but this
is not working. Can anyone please help us.

location / {
proxy_pass      http://localhost;

location wp-login.php?action=lostpassword
rewrite     ^(.*) $1 permanent;

But login url too (wp-login.php?action=login) is redirecting to

*We need to redirect only the url wp-login.php?action=lostpassword to other
and all other url including wp-login.php?action=login need to proxypass*

Can anyone please help us with the correct configuration.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the nginx mailing list