ruby-on-rails – nginx:[emerg]一个重复的默认服务器

当我尝试重启Nginx并在控制台中写入此命令时

Nginx -t

我有一个错误

Nginx: [emerg] a duplicate default server for 0.0.0.0:80 in /etc/Nginx/sites-enabled/default.save:20
Nginx: configuration file /etc/Nginx/Nginx.conf test Failed

启用站点-/

server {
        listen 80 default_server;
        listen [::]:80 default_server ipv6only=on;

        server_name localhost;
        passenger_enabled on;
        rails_env    production;
        root         /home/hh/public;

        access_log  /var/log/Nginx/host.access.log;
        # redirect server error pages to the static page /50x.html
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }
}

Nginx.conf

user www-data;
worker_processes 4;
pid /run/Nginx.pid;

events {
        worker_connections 768;
}

http {

        sendfile on;
        tcp_nopush on;
        tcp_nodelay on;
        keepalive_timeout 65;
        types_hash_max_size 2048;

        include /etc/Nginx/mime.types;
        default_type application/octet-stream;


        access_log /var/log/Nginx/access.log;
        error_log /var/log/Nginx/error.log;

        include /etc/Nginx/conf.d/*.conf;
        include /etc/Nginx/sites-enabled/*;
}

一小时前一切正常,但重启后Nginx我有这个问题.

最佳答案
如果你看一下/ etc / Nginx / sites-enabled /你看到两个文件,default.save和default只删除其中一个

 sudo rm -rf  /etc/Nginx/sites-enabled/default.save 

相关文章

Nginx (engine x) 是一个高性能的HTTP和反向代理服务,也是一...
本地项目配置 1 复制 luffy/settings/dev.py为prop.py 修改l...
nginx不仅可以隐藏版本信息,还支持自定义web服务器信息 先看...
一 、此次漏洞分析 1 nginx HTTP/2漏洞 [nginx-announce] ng...
###进入nginx 目录cd /usr/local/nginx###递归显示 2 级目录...
在cmd命令窗口输入下面命令进行查看 tasklist /fi "ima...