Server_Name regular expression

christospap nginx-forum at nginx.us
Thu Aug 29 09:01:01 UTC 2013


I would like to syntax a regular expression which will match two server
names. The server names are example.com and www.example.com. In particular,
a regular expression for www or nothing

I wrote the following regular expression (www\.|)example.com Nginx
configuration file is compatible with Perl programming language. While it
should work, it doesn't seem to work. I cannot find the proper regular
expression. Does anyone have an idea how to synatx the regular expression?

Thanks

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,242321,242321#msg-242321



More information about the nginx mailing list