ElasticBeanstalk war - 502 Bad Gateway

时间:2017-05-31 20:11:31

标签: java amazon-web-services elastic-beanstalk

我正在尝试将我的java war部署到弹性beanstalk实例,并且无法超越以下错误:

502 Bad Gateway

路线发生了这种情况:http://sample-env.24xzv8dhr2.us-east-1.elasticbeanstalk.com/

我完全确定这是正确的路线,因为它可以在本地工作。这是我的Java代码

@Controller
public class JSONController {

@ResponseStatus(HttpStatus.OK)
@RequestMapping(value = "/",  method = RequestMethod.GET) public void ping()
{
System.out.println("System Working As Designed!");
}  

....       

这是我的日志:

-------------------------------------
/var/log/nginx/error.log
-------------------------------------
2017/05/31 04:35:10 [error] 2180#0: *291 connect() failed (111: Connection refused) while connecting to upstream, client: 220.115.18.5, server: , request: "GET /manager/html HTTP/1.1", upstream: "http://127.0.0.1:5000/manager/html", host: "50.16.232.51"
2017/05/31 06:03:13 [error] 2180#0: *294 connect() failed (111: Connection refused) while connecting to upstream, client: 209.126.136.5, server: , request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:5000/", host: "50.16.232.51"
2017/05/31 10:25:08 [error] 2180#0: *296 connect() failed (111: Connection refused) while connecting to upstream, client: 139.162.119.197, server: , request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:5000/", host: "50.16.232.51"
2017/05/31 11:22:14 [error] 2180#0: *298 connect() failed (111: Connection refused) while connecting to upstream, client: 31.210.102.114, server: , request: "GET / HTTP/1.0", upstream: "http://127.0.0.1:5000/"
2017/05/31 12:06:53 [error] 2180#0: *301 connect() failed (111: Connection refused) while connecting to upstream, client: 189.122.195.204, server: , request: "GET /hndUnblock.cgi HTTP/1.0", upstream: "http://127.0.0.1:5000/hndUnblock.cgi", host: "50.16.232.51"
2017/05/31 12:06:53 [error] 2180#0: *303 connect() failed (111: Connection refused) while connecting to upstream, client: 189.122.195.204, server: , request: "GET /tmUnblock.cgi HTTP/1.0", upstream: "http://127.0.0.1:5000/tmUnblock.cgi", host: "50.16.232.51"
2017/05/31 15:28:34 [error] 2180#0: *305 connect() failed (111: Connection refused) while connecting to upstream, client: 115.239.248.85, server: , request: "GET /shell?%65%63%68%6F%20%63%61%6E%6C%61%6E%67 HTTP/1.1", upstream: "http://127.0.0.1:5000/shell?%65%63%68%6F%20%63%61%6E%6C%61%6E%67", host: "50.16.232.51", referrer: "http://50.16.232.51:80/shell?%65%63%68%6F%20%63%61%6E%6C%61%6E%67"
2017/05/31 15:52:31 [error] 2180#0: *307 connect() failed (111: Connection refused) while connecting to upstream, client: 183.129.160.229, server: , request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:5000/", host: "50.16.232.51"
2017/05/31 16:26:25 [error] 2180#0: *309 connect() failed (111: Connection refused) while connecting to upstream, client: 91.196.50.33, server: , request: "GET http://testp3.pospr.waw.pl/testproxy.php HTTP/1.1", upstream: "http://127.0.0.1:5000/testproxy.php", host: "testp3.pospr.waw.pl"
2017/05/31 17:57:48 [error] 2180#0: *311 connect() failed (111: Connection refused) while connecting to upstream, client: 141.212.122.96, server: , request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:5000/", host: "50.16.232.51"
2017/05/31 18:39:36 [error] 2180#0: *313 connect() failed (111: Connection refused) while connecting to upstream, client: 180.97.106.161, server: , request: "HEAD http://180.163.113.82/check_proxy HTTP/1.1", upstream: "http://127.0.0.1:5000/check_proxy", host: "180.163.113.82"
2017/05/31 20:05:38 [error] 2180#0: *315 connect() failed (111: Connection refused) while connecting to upstream, client: 99.75.147.252, server: , request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:5000/", host: "sample-env.24xzv8dhr2.us-east-1.elasticbeanstalk.com"
2017/05/31 20:05:38 [error] 2180#0: *315 connect() failed (111: Connection refused) while connecting to upstream, client: 99.75.147.252, server: , request: "GET /favicon.ico HTTP/1.1", upstream: "http://127.0.0.1:5000/favicon.ico", host: "sample-env.24xzv8dhr2.us-east-1.elasticbeanstalk.com", referrer: "http://sample-env.24xzv8dhr2.us-east-1.elasticbeanstalk.com/"

入境/出境应该没问题:

HTTP TCP  80  0.0.0.0/0
Custom TCP Rule   TCP  5000  0.0.0.0/0
Custom TCP Rule TCP 5000 ::/0

尝试更正此AWS Elastic Beanstalk错误,我们将不胜感激。健康检查也失败了说“健康状况下降”。

0 个答案:

没有答案