【发布时间】:2014-09-01 13:10:02
【问题描述】:
我对 VPS/Linux 有点陌生,所以请多多包涵。
我有一个指向主机名称服务器的域名 (attendahh.com)。
我已将 /etc/nginx/conf.d/attendahh.com.conf 设置如下:
# the IP(s) on which your node server is running. I chose port 3000.
upstream attendahh.com {
server 127.0.0.1:1999;
}
# the nginx server instance
server {
listen 0.0.0.0:80;
server_name attendahh.com attendahh;
access_log /var/log/nginx/attendahh.log;
# pass the request to the node.js server with the correct headers and much $
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-NginX-Proxy true;
proxy_pass http://attendahh.com/;
proxy_redirect off;
}
}
那我service nginx restart。
我已经阅读了一堆教程和堆栈答案,这表面上是我需要做的,但如果我去http://attendahh.com 它不起作用。
注意事项:
- 在浏览器中访问我的 IP + 端口可以正常工作 (
23.226.227.16:1999) - 我安装了用于 VPS 的 Cpanel(我最初尝试在其中设置 DNS,但没有成功,我已经从那里删除了 dns 条目,但它可能仍然会影响事情)
- Apache
virtual hosts在httpd.config中被注释掉。
关于我在这里做错了什么有什么想法吗? apache和nginx之间可能有冲突?
【问题讨论】:
标签: linux apache nginx dns centos