Help with specific redirect to https

Francis Daly francis at
Wed Dec 12 23:42:48 UTC 2012

On Wed, Dec 12, 2012 at 12:22:51PM -0700, Pete Ashdown wrote:

Hi there,

> This is what it looks like via Mediawiki.  The &returnto argument is
> dependent on where the Login button is hit, and may or may not be present.

In nginx terms, for this request, $uri = /index.php. $uri is what both
"rewrite" and "location" match against. That is why the first few attempts
did not do what you hoped they would.

Some other variables which are available include:

$request_uri = /index.php?title=Special:UserLogin&returnto=Main+Page
$args = title=Special:UserLogin&returnto=Main+Page
$arg_title = Special:UserLogin

So you can do an exact or regex match of any of those in a "map" to set
another variable; or you can match directly in an "if"; and then return
the redirection.

All the best,

Francis Daly        francis at

More information about the nginx mailing list