[英]NGINX+NODE JS - no live upstreams while connecting to upstream, client: 127.0.0.1
I am getting following error in error.log file nginx conf file. 我在error.log文件nginx conf文件中遇到以下错误。
I am trying to run nginx server on to of node js server. 我正在尝试在节点js服务器上运行nginx服务器。
Error : no live upstreams while connecting to upstream, client: 127.0.0.1, server: www.XYZ.com, request: "GET / HTTP/1.0", upstream: " http://localhost/ ", host: "localhost"
错误:连接到上游时没有实时上游,客户端:127.0.0.1,服务器:www.XYZ.com,请求:“ GET / HTTP / 1.0”,上游:“ http:// localhost / ”,主机:“ localhost”
Node js server is running on port 3000 and nginx on port 80 Node js服务器在端口3000上运行,nginx在端口80上运行
nginx conf file is nginx conf文件是
http {
include mime.types;
default_type application/octet-stream;
#log_format main '$remote_addr - $remote_user [$time_local] "$request" '
# '$status $body_bytes_sent "$http_referer" '
# '"$http_user_agent" "$http_x_forwarded_for"';
#access_log logs/access.log main;
sendfile on;
#tcp_nopush on;
#keepalive_timeout 0;
keepalive_timeout 128;
#gzip on;
server_names_hash_bucket_size 64;
client_header_timeout 3000;
client_body_timeout 3000;
fastcgi_read_timeout 3000;
client_max_body_size 32m;
fastcgi_buffers 8 128k;
fastcgi_buffer_size 128k;
server {
listen 80 ;
server_name XYZ.com;
location / {
# Base url of the Data Science Studio installation
proxy_pass http://localhost: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;
}
}
}
and node js server is running on port 3000 并且节点js服务器在端口3000上运行
app.listen(3000);
It looks like nginx is trying to connect to node js server on dafault port 80 and not 3000. 看起来nginx试图连接到dafault端口80而不是3000上的node js服务器。
Please help me with the issue. 请帮我解决这个问题。 I have spend lot of time on it but no luck.
我花了很多时间,但没有运气。
Thanks 谢谢
对我来说,我通过将proxy_pass移动到proxy_set_header之后的配置块末尾来修复它。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.