[英]Java HttpURLConnection failed to connect to ASP.NET API, connection refused
[英]connect() failed (111: Connection refused) while connecting to upstream. Java (SparkJava) amazon Elastic
嘗試部署我的第一個應用程序(后端)。 但是我遇到了502 Bad Gateway類型的錯誤。
2016/05/03 14:46:14 [error] 2247#0: *19 connect() failed (111: Connection refused) while connecting to upstream, client: 172.31.43.183, server: , request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:5000/", host: "myHost.eu-west-1.elasticbeanstalk.com"
2016/05/03 14:50:23 [error] 2566#0: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 172.31.8.36, server: , request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:5000/", host: "myHost.eu-west-1.elasticbeanstalk.com"
2016/05/03 14:55:04 [error] 2566#0: *61 connect() failed (111: Connection refused) while connecting to upstream, client: 172.31.43.183, server: , request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:5000/", host: "myHost.eu-west-1.elasticbeanstalk.com"
我使用在端口4567上啟動的后端框架SparkJava。因此,我擴展了Nginx的配置(nginx / 1.8.1)。 但是問題始終存在。
server {
listen 4567 default_server;
listen [::]:4567 default_server ipv6only=on;
}
有關信息:我的后端與數據庫通信(RDS aws亞馬遜)
從您的日志中: upstream: "http://127.0.0.1:5000/"
我看到,nginx試圖連接到同一台計算機上的5000端口,並且拒絕連接。 5000端口上正在運行什么? 您可能需要調查一下。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.