Welcome! Log In Create A New Profile

Advanced

Can you do this with wildcards?

Posted by jrm 
jrm
Can you do this with wildcards?
August 31, 2009 08:27PM
Is there a way to do the following with a wildcard in the server name? We have some domains with names like something-code1.company.com, something-code2.company.com, something-coden.company.com. We would like to set the server name in the config to something-*.company.com but when I do this I get:

Restarting nginx: [emerg]: invalid server name or wildcard "something-*.company.com" on 0.0.0.0:80

My simple config for this test is:

server {
listen 80;
server_name something-code1.company.com something-*.company.com;
root /var/www/my_dir;
index index.html;
}
Re: Can you do this with wildcards?
September 01, 2009 02:15PM
Give this a try:
[code]
server_name something-code1.company.com ~something-.*\.company\.com;
[/code]
The tilde at the beginning identifies it as a regular expression.



Edited 2 time(s). Last edit at 09/01/2009 02:17PM by brianmercer.
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 232
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready