Wildcard servername error

Igor Sysoev is at rambler-co.ru
Fri Jan 23 16:34:45 MSK 2009


On Fri, Jan 23, 2009 at 02:31:20PM +0100, Zoltan HERPAI wrote:

> Hi,
> 
> I would like to use the following servernames in my vhost configuration:
> 
> server_name     test.domain1 test.domain2 test.*.domain1 test.*.domain2;
> 
> I've read in the doc (http://wiki.codemongers.com/NginxVirtualHostExample) 
> that it's possible to do this, however when I try to start nginx, it dies 
> with the following:
> 
> Starting nginx: 2009/01/23 14:28:36 [emerg] 19004#0: invalid server name 
> or wildcard "test.*.domain1" on 0.0.0.0:81
> 
> This nginx-0.6.34 is installed from Ubuntu repository, if this counts. Can 
> anyone shed some light please on this problem?

Use regex:

server_name     test.domain1 test.domain2
                ~^test\..+\.domain1$ ~^test\..+\.domain2$;


-- 
Igor Sysoev
http://sysoev.ru/en/





More information about the nginx mailing list