
Não consigo descobrir como resolver o seguinte aviso ao executar nginx -t
:
2022/12/29 05:10:23 [warn] 24920#24920: conflicting server name "" on 0.0.0.0:80, ignored
2022/12/29 05:10:23 [warn] 24920#24920: conflicting server name "" on [::]:80, ignored
Tenho dois sites em execução no meu servidor.
- home.conf
server {
listen 80 default_server;
listen [::]:80 default_server;
root /var/www/home;
index index.html
server_name int.mycompany.lan;
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ =404;
}
}
- bug.conf
server {
listen 80;
listen [::]:80;
root /var/www/bug;
index index.html
server_name bug.int.mycompany.lan;
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ =404;
}
}
Indo para o sitebug.int.minhaempresa.lansempre me mostra oint.minhaempresa.lanem vez disso.
Se eu remover o link simbólico para um desses arquivos de /etc/nginx/sites-enabled ou se eu alterar a porta em um dos sites para algo como 8081, não receberei mais o erro acima.
Responder1
Erro bobo. Excluí o ponto e vírgula da index
linha. Isso me levou várias horas para detectar.