

![]() | Start a set with this search |
![]() | Include this search in one of my sets |
![]() | Exclude this search from one of my sets |
![]() | Permalink to these results Paste this link in email or IM: |
| Atom feed for tracking future search results Paste this URL into your reader: |
10 messages in ru.sysoev.nginxRe: Nginx rewrite host| From | Sent On | Attachments |
|---|---|---|
| Glen Lumanau | Feb 10, 2009 8:44 pm | |
| Kingsley Foreman | Feb 11, 2009 12:25 am | |
| Glen Lumanau | Feb 11, 2009 12:34 am | |
| Tomasz Pajor | Feb 11, 2009 1:31 am | |
| Igor Sysoev | Feb 11, 2009 1:36 am | |
| Tomasz Pajor | Feb 11, 2009 2:05 am | |
| Igor Sysoev | Feb 11, 2009 2:09 am | |
| Glen Lumanau | Jun 10, 2009 12:58 am | |
| Maxim Dounin | Jun 10, 2009 2:06 am | |
| Glen Lumanau | Jun 10, 2009 2:24 am |

![]() | Permalink for this message Paste this link in email or IM: |
![]() | Permalink for this thread Paste this link in email or IM: |
| Atom feed for this thread Paste this URL into your reader: |
| Subject: | Re: Nginx rewrite host | Actions... |
|---|---|---|
| From: | Maxim Dounin (mdou...@mdounin.ru) | |
| Date: | Jun 10, 2009 2:06:10 am | |
| List: | ru.sysoev.nginx | |
Hello!
On Wed, Jun 10, 2009 at 02:59:15PM +0700, Glen Lumanau wrote:
It's working if we are redirecting the traffic to onother domain.
But what i need is something like
if ($host != www.mydomain.com){ rewrite ^(.*)$ http://www.mydomain.com$1 break; }
Is there any way to do this?
It's just question of writing correct server{} declarations.
server { listen 80 default; server_name_in_redirect off;
rewrite ^ http://www.mydomain.com$request_uri?; }
server { server_name www.mydomain.com; ... }
Maxim Dounin
-----Original Message----- From: owne...@sysoev.ru [mailto:owne...@sysoev.ru] On Behalf Of Igor Sysoev Sent: 11 Februari 2009 16:37 To: ngi...@sysoev.ru Subject: Re: Nginx rewrite host
On Wed, Feb 11, 2009 at 10:31:38AM +0100, Tomasz Pajor wrote:
if ($host !~* "(blah.com|blah2.com)") { rewrite ^(.*)$ http://blah.com$1 break; }
Reference: http://wiki.codemongers.com/NginxHttpRewriteModule#if
Never! Never use "if" just to test $host. There is special very optimized directives server/server_name:
server { server_name blah1.com blah2.com; rewrite ^ http://blah.com$request_uri; }
-- Tom Pajor
Hello!
How can I add 2 or more host?
*From:* owne...@sysoev.ru [mailto:owne...@sysoev.ru] *On Behalf Of *Kingsley Foreman *Sent:* 11 Februari 2009 15:26 *To:* ngi...@sysoev.ru *Subject:* Re: Nginx rewrite host
if ($host != blah.com){ rewrite ^(.*)$ http://blah.com$1 break; }
*From:* Glen Lumanau <mailto:gl...@lumanau.web.id>
*Sent:* Wednesday, February 11, 2009 3:14 PM
*To:* ngi...@sysoev.ru <mailto:ngi...@sysoev.ru>
*Subject:* Nginx rewrite host
Hello!
How can I create this rule
If host = 127.0.0.1, 127.0.0.2
Do nothing
If host != 127.0.0.1, 127.0.0.2
Rewrite bla bla bla
Thank you for any help
-- Igor Sysoev http://sysoev.ru/en/







