Welcome! Log In Create A New Profile

Advanced

Re: Can nginx do this?

August 07, 2009 04:21AM
On Fri, Aug 07, 2009 at 03:10:10PM +0800, lhmwzy wrote:

> if ($http_host ~* "^((?!www).*)\.afen\.com$") {
> set $name $1;
> rewrite ^ http://www.afen.com/$name$uri;
> }
>
> this can works.

server {
server_name www.afen.com;
...
}

server {
server_name ~^(.*)\.afen\.com$;
rewrite ^ http://www.afen.com/$1$request_uri?;
}


--
Igor Sysoev
http://sysoev.ru/en/
Subject Author Posted

Re: Can nginx do this?

lhmwzy August 07, 2009 12:28AM

Re: Can nginx do this?

Jeff Waugh August 07, 2009 02:27AM

Re: Can nginx do this?

lhmwzy August 07, 2009 03:09AM

Re: Can nginx do this?

lhmwzy August 07, 2009 03:10AM

Re: Can nginx do this?

Igor Sysoev August 07, 2009 04:21AM

Re: Can nginx do this?

lhmwzy August 07, 2009 04:52AM

Re: Can nginx do this?

Igor Sysoev August 07, 2009 05:07AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 306
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready