我有一个node.js应用程序运行在我的Ubuntu 14.04 VPS上。 通过Cloudfare从dns到pm2运行应用程序,一切都设置完成。Nginx:[警告]冲突服务器名称“non.com”在0.0.0.0:80,忽略
我遇到了与Nginx配置文件冲突的问题。 我对这一切都很陌生,所以我不知道它是如何工作的100%。
做一些谷歌搜索显示我通过使用纳米编辑器可能有.save
文件,使它冲突,我检查,情况并非如此。虽然,我确实在/nginx/sites-available/
和/nginx/sites-enabled/
内有相同的文件。
这里被称为default
文件:我重启nginx的我得到一个警告nginx: [warn] conflicting server name "domainName.com" on 0.0.0.0:80, ignored
server {
listen 80;
server_name domainName.com;
location/{
proxy_pass http://MY-IP:3000/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
}
每次。
这里是我的nginx.conf
文件:
user www-data;
worker_processes 4;
pid /run/nginx.pid;
events {
worker_connections 768;
# multi_accept on;
}
http {
##
# Basic Settings
##
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;
gzip on;
gzip_disable "msie6";
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
}
和ls -al /etc/nginx/sites-enabled
输出:
ls -alh /etc/nginx/conf.d/
的
total 8
drwxr-xr-x 2 root root 4096 Aug 28 07:33 .
drwxr-xr-x 5 root root 4096 Aug 28 07:33 ..
lrwxrwxrwx 1 root root 34 Aug 28 07:33 default -> /etc/nginx/sites-available/default
:
total 8.0K
drwxr-xr-x 2 root root 4.0K Jul 12 06:35 .
drwxr-xr-x 5 root root 4.0K Aug 28 07:33 ..
我不知道还能做什么,任何帮助,将不胜感激。
发布你的nginx.conf和'ls -al/etc/nginx/sites-enabled' –
@TarunLalwani我添加了你所问的内容,它在帖子的末尾。 –
还需要'ls -alh/etc/nginx/conf.d /'和其中的任何配置的内容 –