nginx错误“服务器名称冲突";被忽略 [英] nginx error "conflicting server name" ignored

查看:89
本文介绍了nginx错误“服务器名称冲突";被忽略的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

server {
    #listen   80; ## listen for ipv4; this line is default and implied
    #listen   [::]:80 default ipv6only=on; ## listen for ipv6

    #root /usr/share/nginx/www;

root /home/ubuntu/node-login;
    # Make site accessible from 
    server_name ec2-xx-xx-xxx-xxx.us-west-1.compute.amazonaws.com;

location /{
    proxy_pass http://127.0.0.1:8000/;
    proxy_redirect off;
}

}

这将导致nignx错误[警告]冲突的服务器名称"ec2 ..."在0.0.0.0:80上被忽略 我不明白,任何解释表示赞赏.谢谢.

this results in nignx error [warn] conflicting server name "ec2..." on 0.0.0.0:80 ignored I dont understand, any explanation appreciated. Thanks.

推荐答案

我假设您正在运行Linux,并且您正在使用gEdit编辑文件.在/etc/nginx/sites-enabled中,它可能已经留下了一个临时文件,例如default~(观看~).

I assume that you're running a Linux, and you're using gEdit to edit your files. In the /etc/nginx/sites-enabled, it may have left a temp file e.g. default~ (watch the ~).

根据您的编辑器,文件可以命名为.save或类似名称.只需运行$ ls -lah即可查看不需要的文件并将其删除(为此,感谢 @Tisch ).

Depending on your editor, the file could be named .save or something like it. Just run $ ls -lah to see which files are unintended to be there and remove them (Thanks @Tisch for this).

删除此文件,它将解决您的问题.

Delete this file, and it will solve your problem.

这篇关于nginx错误“服务器名称冲突";被忽略的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆