nginx如何确定我有一个冲突的服务器名称?
[warn] conflicting server name "" on 0.0.0.0:80, ignored 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
}
}
答案 0 :(得分:1)
答案是:
索引index.html
后缺少半冒号对于那些感兴趣的人,您可以将server_name设置为.project.ca
而不是project.ca *.project.ca
,因为它们都是相同的。