Welcome! Log In Create A New Profile

Advanced

Re: How to redirect to a query

Francis Daly
March 09, 2011 07:04AM
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 http://sysoev.ru/nginx/ with useful English-language
content at http://www.nginx.org/en/docs/ and http://wiki.nginx.org/

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 = 'one.mysite.com' and $arg_index
> = "" then it should go to one.mysite.com/?index=site&id=1 if
> two.mysite.com it go to two.mysite.com/?index=site&id=2

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,

f
--
Francis Daly francis@daoine.org

_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx
Subject Author Posted

How to redirect to a query

sjark March 08, 2011 09:43AM

Re: How to redirect to a query

Francis Daly March 08, 2011 04:06PM

Re: How to redirect to a query

sjark March 09, 2011 04:51AM

Re: How to redirect to a query

Igor Sysoev March 09, 2011 04:58AM

Re: How to redirect to a query

sjark March 09, 2011 05:50AM

Re: How to redirect to a query

Francis Daly March 09, 2011 07:04AM

Re: How to redirect to a query

Francis Daly March 09, 2011 06:32AM

Re: How to redirect to a query

sjark March 09, 2011 07:35AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 105
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready