sign * in server_name

Martin Minka martin.minka at gmail.com
Fri Jun 8 22:57:34 MSD 2007


Igor,
sorry for delay. You are always so quick, my performance is not as yours ;).

I tested the server_name directive and it works.
The usage of _ is a little bit annoying, could it be fixed in future ?

Tested example in file nginx.conf.default :

	server {
		listen 80;
		# server_name test.*; # does not work !
		server_name _ test.*; # works fine
         location / {
             root   html;
             index  test.html;
         }		
	}

I am not using map and valid_referer, hope somebody else will test it or 
me after I will learn them.

Thank you very much!
Martin Minka

Igor Sysoev wrote:
> On Wed, Jun 06, 2007 at 12:53:30PM +0400, Igor Sysoev wrote:
> 
>> On Wed, Jun 06, 2007 at 08:50:47AM +0200, Martin Minka wrote:
>>
>>> There is written in Wiki documentation that it is possible to use * as 
>>> first part of name in server_name directive.
>>> I need to catch all servers directed to my server which name starts with 
>>> a word.
>>>
>>> For example will this work ?
>>>
>>> 	server {
>>> 		listen 80;
>>> 		server_name main.server.com partner.* affiliate.* ;	 
>>> 		......
>>>
>>> If not, is there another way to achieve this ?
>> nginx currently does not support such wildcards, but it is relatively easy
>> to add them, because their handling is the same as "*.site.com".
> 
> The attached patch adds the "www.text.*" wildcards (full tail part only)
> to the "server_name", "map", and "valid_referer" directives.
> 
> Could you test it ?
> 
> 





More information about the nginx mailing list