Nginx配置文件

Nginx配置文件,nginx,Nginx,nginx如何认为我有一个冲突的服务器名 [warn]在0.0.0.0:80上有冲突的服务器名称“”,已忽略nginx。 我不在乎,只是它似乎只提供project.ca的文件,而完全忽略了projectfinancial.com server { root /var/www/project/infrastructure/project/static-sites/projectlabswebsite; index index.html server_

nginx如何认为我有一个冲突的服务器名

[warn]在0.0.0.0:80上有冲突的服务器名称“”,已忽略nginx。

我不在乎,只是它似乎只提供project.ca的文件,而完全忽略了projectfinancial.com

server {
        root /var/www/project/infrastructure/project/static-sites/projectlabswebsite;
        index index.html
        server_name projectfinancial.com *.projectfinancial.com;
        location / {
                # First attempt to serve request as file, then
                # as directory, then fall back to index.html
                try_files $uri $uri/ /index.html;
                # Uncomment to enable naxsi on this location
                # include /etc/nginx/naxsi.rules
        }
}

server {
        root /var/www/project/infrastructure/project/static-sites/project-website;
        index index.html
        server_name project.ca *.project.ca;
        location / {
                # First attempt to serve request as file, then
                # as directory, then fall back to index.html
                try_files $uri $uri/ /index.html;
                # Uncomment to enable naxsi on this location
                # include /etc/nginx/naxsi.rules
        }
}
答案是:

index.html后缺少分号

对于感兴趣的用户,您可以将服务器名称设置为
.project.ca
,而不是
project.ca*.project.ca
,因为它们都是相同的