我正在我的 centos 7 上安装 nodejs 和 nginx。我的应用程序在 my_domain:3000 上运行良好,但在 my_domain.com 上出现错误,并显示您正在查找的页面暂时不可用。请稍后再试。这是我的 nginx.conf。请帮助 nginx.conf
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name digitaloceantwo.25o2.in;
root /usr/share/nginx/html;
# Load configuration files for the default server block.
include /etc/nginx/default.d/*.conf;
location / {
proxy_pass http://digitaloceantwo.25o2.in:8080;
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;
}
error_page 404 /404.html;
location = /40x.html {
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
}
}
你好.js
var http = require('http');
http.createServer(function (req, res) {
res.writeHead(200, {'Content-Type': 'text/plain'});
res.end('Hello World\n');
}).listen(8080,'159.65.150.176');
console.log('Server running at http://digitaloceantwo.25o2.in:8080/');