redirect subdomain to internal location

Igor Sysoev igor at sysoev.ru
Wed May 25 17:21:00 MSD 2011


On Wed, May 25, 2011 at 07:43:54AM -0400, chris.percol wrote:
> How would I test for the following subdomains?
> 
> www
> www4
> any other subdomain 
> 
> Then redirect each to a corresponding internal location?
> 
> I am using the following code to get the 'any other subdomain' but can't
> get the redirect to a  location such as @any_subd working?
> 
> if ($host ~* "(.*)\.tm2app\.com") {
>   set $subd $1;
> }

Could you describe using examples, but not "if/set" ?
nginx virtual server names are described here:
http://nginx.org/en/docs/http/server_names.html


-- 
Igor Sysoev



More information about the nginx mailing list