当用户键入特定域时,我试图显示我的NodeJS应用程序。我已经将域指向服务器上,然后安装了Nginx并创建了一个配置文件:
/etc/nginx/conf.d/myapp.conf这有以下内容:
server {
listen 80;
server_name myapp.it www.myapp.it;
location / {
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Host $http_host;
proxy_pass http://localhost:4568;
}
}我重新启动了Nginx并执行了以下命令:nginx -t,但我得到了:
nginx: [warn] conflicting server name "myapp.it" on 0.0.0.0:80, ignored
nginx: [warn] conflicting server name "www.myapp.it" on 0.0.0.0:80, ignored当我访问这个域时,我被禁止使用403,这是因为Letsencrypt不能为上面的冲突注册证书。我做错了什么?
发布于 2020-10-17 16:40:18
您应该将站点配置文件放入启用/etc/nginx/ site中。
要解决问题,请检查是否启用了/etc/nginx/ site中的默认站点配置,并将其删除。然后,将您的myapp.conf文件移动到/etc/ nginx /sites启用并重新启动nginx。
https://serverfault.com/questions/1039102
复制相似问题