Docker Nginx 502错误的网关ipv6

问题

我正试图在一台Ubuntu服务器上实现一个docker + nginx安装程序,并使用upstart和一个node.js应用程序。

我有node.js应用程序运行,我可以直接连接到它。 而nginx的默认服务器为我工作。 但是,当我尝试连接这两个networking时,遇到了502个坏的网关。 我想知道,如果这可能是由于我的ipv6节点地址(不是故意的,但显示在下面的netstat)。

对不起,如果这是一个noob问题/configuration问题。 我是nginx和Ubuntu的新手。 我已经梳理了一些有用的文章,发现整洁的Linux命令,但迄今没有任何解决scheme为我工作。

cat / proc / version:

Linux version 4.4.0-72-generic (buildd@lcy01-24) (gcc version 4.8.4 (Ubuntu 4.8.4-2ubuntu1~14.04.3) ) #93~14.04.1-Ubuntu SMP Fri Mar 31 15:05:15 UTC 2017 

netstat -tpln

 Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 127.0.0.1:21 0.0.0.0:* LISTEN 599/vsftpd tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1305/sshd tcp 0 0 127.0.0.1:27017 0.0.0.0:* LISTEN 24199/mongod tcp6 0 0 :::22 :::* LISTEN 1305/sshd tcp6 0 0 :::8443 :::* LISTEN 11608/.node.bin tcp6 0 0 :::80 :::* LISTEN 13646/docker-proxy 

nginx.conf

 # the IP(s) on which your node server is running. upstream app_yourdomain { server [::1]:8443; keepalive 8; } # the nginx server instance server { listen 80; server_name [::1]; rewrite_log on; error_log /var/log/nginx/localhost.error_log notice; # pass the request to the node.js server with the correct headers # and much more can be added, see nginx config options location / { proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; 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://app_yourdomain; proxy_redirect off; } } 

error.log中

在app_yourdomain中使用服务器http:// 127.0.0.1:8443

 2017/05/02 21:50:22 [error] 5#5: *1 connect() failed (111: Connection refused) while connecting to upstream, client: XXX.XXX.XXX.XX, server: http://XXX.XX.XXX.XXX, request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:8443/", host: "XXX.XX.XXX.XXX" 2017/05/02 21:50:22 [warn] 5#5: *1 upstream server temporarily disabled while connecting to upstream, client: XXX.XXX.XXX.XX, server: http://XXX.XX.XXX.XXX, request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:8443/", host: "XXX.XX.XXX.XXX" 

在app_yourdomain中使用server [:: 1]:8443

 2017/05/02 22:13:20 [crit] 5#5: *1 connect() to [::1]:8443 failed (99: Cannot assign requested address) while connecting to upstream, client: XXX.XXX.XXX.XX, server: localhost, request: "GET / HTTP/1.1", upstream: "http://[::1]:8443/", host: "XXX.XX.XXX.XXX"