Regular expression used in server_name directive

Francis Daly francis at
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$;

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?

Francis Daly        francis at

More information about the nginx mailing list