Redirect to a different url based on a query.

Francis Daly francis at daoine.org
Wed Sep 24 12:40:02 UTC 2014


On Thu, Sep 18, 2014 at 07:34:32PM +0530, Geo P.C. wrote:

Hi there,

> *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*

Untested, but something like

location = /wp-login.php {
  if ($arg_action = lostpassword) {
    return 301 http://whatever$request_uri;
  }
  proxy_pass wherever;
}

should probably come close to what you want. You could test "$args =
action=lostpassword" if that better describes the requests that you want
to handle specially.

	f
-- 
Francis Daly        francis at daoine.org



More information about the nginx mailing list