Regular expression used in server_name directive

Francis Daly francis at daoine.org
Sun Mar 3 20:04:58 UTC 2013


On Sun, Mar 03, 2013 at 02:21:10PM -0500, justin wrote:

Hi there,

> I actually have a working regular expression which should work now:
> 
>    server_name ^(?!web3\.)(?<account>.+)\.mydomain\.com$;

http://nginx.org/r/server_name

Pay particular attention to the line that begins "It is also possible
to use regular expressions in server names".

> But for some odd reason when I restart nginx, I am getting:
> 
>   nginx: [emerg] unknown "account" variable

Did you get that message when you tested with your initial version too?

	f
-- 
Francis Daly        francis at daoine.org



More information about the nginx mailing list