using foo.* as wilcards

Maxim Dounin mdounin at
Thu Nov 5 01:04:24 MSK 2009


On Wed, Nov 04, 2009 at 04:00:03PM -0500, Chris Kelly wrote:

> hello. I'm using nginx 0.6.39 and trying to get wildcards like
> foo.* working which according to
> should work, but I get
> "invalid serer name or wildcard" when attempting to start nginx.
> nothing in the changelog indicates that a newer version of nginx
> would fix this.

It shouldn't work, this wiki example is wrong.  Feel free to fix 

Wildcards only allowed at start or at end of server name.  For 
arbitrary matching use regular expressions, see here for details:

> Any suggestions on a way to make this work? It's a rather odd
> situation, but * and foo.* live on separate
> clusters of web servers.

server_name ~^foo\..*\.example\.com;

Maxim Dounin

More information about the nginx mailing list