Regular expression used in server_name directive

Francis Daly francis at daoine.org
Sun Mar 3 19:12:50 UTC 2013


On Sun, Mar 03, 2013 at 12:43:57PM -0500, justin wrote:

Hi there,

> I am using a regular expression with a capture group in my server_name
> directive. It looks like:
> 
>     server_name (?<account>.+)\.mydomain\.com$

http://nginx.org/r/server_name for details of how the matching server{}
block is chosen.

> The problem is that I want to expand it slightly and say anything except
> web3.mydomain.com. I.E.
> 
>    something.mydomain.com matches, but web3.mydomain.com does not match.
> 
> How is this possible?

Make a different server{} block that matches web3.mydomain.com.

	f
-- 
Francis Daly        francis at daoine.org



More information about the nginx mailing list