nginx错误:bind()到0.0.0.0:80失败(98:未知错误); 0.0.0.0:80上有冲突的服务器名称“”,已忽略

qojgxg4l  于 2023-06-28  发布在  Nginx
关注(0)|答案(1)|浏览(370)

我托管了一个配置了反向代理的nginx web服务器。我需要更新一些证书。我在一些域的一些配置中有错误的配置。修复后,nginx不能启动了,我不能得到任何错误。我谷歌了这么多,没有什么运行在端口80除了nginx。我不明白空的服务器名。哪个服务器名?

edit:似乎我修复了server_name“”警告。但这并不能解决问题。Systemctl status:

nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Unknown error)

sudo grep -r server_name /etc/nginx* output:

/etc/nginx/sites-enabled/pitlivesforever.conf:   server_name pitlivesforever.de;

/etc/nginx/sites-enabled/pitlivesforever.conf:   server_name pitlivesforever.de;
/etc/nginx/sites-enabled/calmingsurround.conf:   server_name calmingsurround.de;

/etc/nginx/sites-enabled/calmingsurround.conf:   server_name calmingsurround.de;
/etc/nginx/sites-enabled/walrussi.conf:   server_name walrussi.com;
/etc/nginx/sites-enabled/walrussi.conf:   server_name walrussi.com;
/etc/nginx/sites-enabled/onlyoffice.walrussi.conf:    server_name onlyoffice.walrussi.com;
/etc/nginx/sites-enabled/onlyoffice.walrussi.conf:    return 301 https://$server_name$request_uri;
/etc/nginx/sites-enabled/onlyoffice.walrussi.conf:    server_name onlyoffice.walrussi.com;
/etc/nginx/sites-enabled/bitwarden.walrussi.com:    server_name bitwarden.walrussi.com; #Change this to your domain name
/etc/nginx/sites-enabled/bitwarden.walrussi.com:  server_name bitwarden.walrussi.com; #Change this to your domain name
/etc/nginx/sites-enabled/wiki.walrussi.com.conf:    server_name wiki.walrussi.com;
/etc/nginx/sites-enabled/wiki.walrussi.com.conf:    return 301 https://$server_name$request_uri;
/etc/nginx/sites-enabled/wiki.walrussi.com.conf:    server_name wiki.walrussi.com;
/etc/nginx/sites-enabled/nextcloud.conf:   server_name nextcloud.walrussi.com;          
/etc/nginx/sites-enabled/nextcloud.conf:  return 301 https://$server_name$request_uri;
/etc/nginx/sites-enabled/nextcloud.conf:    server_name nextcloud.walrussi.com;
/etc/nginx/sites-enabled/dyndns.conf:    server_name libellulanas.lohse.de;
/etc/nginx/sites-enabled/dyndns.conf:    return 301 https://$server_name$request_uri;
/etc/nginx/sites-enabled/dyndns.conf:    server_name libellulanas.lohse.de;
/etc/nginx/scgi_params:scgi_param  SERVER_NAME        $server_name;
/etc/nginx/nginx.conf.old:  # server_names_hash_bucket_size 64;
/etc/nginx/nginx.conf.old:  # server_name_in_redirect off;
/etc/nginx/nginx.conf:  # server_names_hash_bucket_size 64;
/etc/nginx/nginx.conf:  # server_name_in_redirect off;
/etc/nginx/sites-available/default:        server_name _;
/etc/nginx/sites-available/default:#       server_name example.com;
/etc/nginx/uwsgi_params:uwsgi_param  SERVER_NAME        $server_name;
/etc/nginx/fastcgi.conf:fastcgi_param  SERVER_NAME        $server_name;
/etc/nginx/fastcgi_params:fastcgi_param  SERVER_NAME        $server_name;
  • 这里的错误:*
2023/06/24 13:09:12 [warn] 4027610#4027610: conflicting server name "" on 0.0.0.0:80, ignored
2023/06/24 13:09:12 [warn] 4027610#4027610: conflicting server name "" on 0.0.0.0:80, ignored
2023/06/24 13:09:12 [warn] 4027611#4027611: conflicting server name "" on 0.0.0.0:80, ignored
2023/06/24 13:09:12 [warn] 4027611#4027611: conflicting server name "" on 0.0.0.0:80, ignored
2023/06/24 13:09:12 [emerg] 4027611#4027611: bind() to 0.0.0.0:80 failed (98: Unknown error)
2023/06/24 13:09:12 [emerg] 4027611#4027611: bind() to 0.0.0.0:80 failed (98: Unknown error)
2023/06/24 13:09:12 [emerg] 4027611#4027611: bind() to 0.0.0.0:80 failed (98: Unknown error)
2023/06/24 13:09:12 [emerg] 4027611#4027611: bind() to 0.0.0.0:80 failed (98: Unknown error)
2023/06/24 13:09:12 [emerg] 4027611#4027611: bind() to 0.0.0.0:80 failed (98: Unknown error)
2023/06/24 13:09:12 [emerg] 4027611#4027611: still could not bind()
  • sudo nginx -t:*
nginx: [warn] conflicting server name "" on 0.0.0.0:80, ignored
nginx: [warn] conflicting server name "" on 0.0.0.0:80, ignored
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
  • systemctl status ngingx.service:*
× nginx.service - A high performance web server and a reverse proxy server
     Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Sat 2023-06-24 13:09:15 UTC; 9min ago
       Docs: man:nginx(8)
    Process: 4027610 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
    Process: 4027611 ExecStart=/usr/sbin/nginx -g daemon on; master_process on; (code=exited, status=1/FAILURE)
        CPU: 82ms
  • netstat -tulpn| grep --color:80:*
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      3366/nginx: master  
tcp        0      0 127.0.0.1:8080          0.0.0.0:*               LISTEN      1916/docker-proxy
  • 我希望我只是监督一些空(?!)config但我找不到它。谢谢你的帮助!我试图创建“默认”域配置,如果可能nginx缺少默认值?已升级系统。已杀死所有nginx进程并尝试重新启动。*
hmae6n7t

hmae6n7t1#

@sleepyhead
我会一次重建一个域的配置,直到你遇到问题,你可以使用重新加载来添加配置,而其他网站保持正常。从上面看我找不出毛病
这招奏效了哈哈。是我的错。

相关问题