How to redirect to a query

Francis Daly francis at
Wed Mar 9 15:02:00 MSK 2011

On Wed, Mar 09, 2011 at 05:50:33AM -0500, sjark wrote:

Hi there,

> Thanks that works! one more question

The main docs are at with useful English-language
content at and

If you end up guessing the config syntax, could you mention which docs
you read that were unclear? That way, hopefully, they can be fixed --
or the "right" docs made more findable -- so that the next person with
the same difficulty will have an easier time. Thanks!

> can I do something like this if $host = '' and $arg_index
> = "" then it should go to if
> it go to

In nginx, "different host names" usually means "different server{}
blocks". That way, you only have one if() condition to worry about,
which reduces it to a problem already solved :-)

I realise this may be a simplified example, but: if "index" must always
be present and always equal to "site", then perhaps whatever handles
the request could be told to assume that? This is similar to Igor's
"don't redirect; handle it internally" suggestion.

Maybe similar analysis will make your full application configuration be
clear too.

Good luck with it,

Francis Daly        francis at

More information about the nginx mailing list