Beanstalk 502 Bad Gateway Spring应用程序 [英] Beanstalk 502 Bad Gateway Spring application

查看:87
本文介绍了Beanstalk 502 Bad Gateway Spring应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在AWS Beanstalk上使用Spring应用程序上传了我的war文件,但是它不起作用.使用Tomcat,一切都可以在我的本地计算机上完美运行.我尝试将环境变量PORT设置为8080,但不幸的是没有任何变化.从我的日志中,我收到以下问题:

I have uploaded my war file with Spring application on AWS Beanstalk but it doesn't work. Everything works perfectly on my local machine with Tomcat. I tried setting environment variable PORT to 8080 but unfortunately nothing has changed. From my logs I get following issue:

2016/01/05 17:07:20 [错误] 2704#0:* 1连接到上游客户端时,connect()失败(111:连接被拒绝): 89.73.213.69,服务器:,请求:"GET/favicon.ico HTTP/1.1",上游:" http://127.0.0.1:5000/favicon.ico ",主持人:"sknera-vpzbac3zaq.elasticbeanstalk.com",引荐网址:" http://sknera-vpzbac3zaq.elasticbeanstalk.com/"

2016/01/05 17:07:20 [error] 2704#0: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 89.73.213.69, server: , request: "GET /favicon.ico HTTP/1.1", upstream: "http://127.0.0.1:5000/favicon.ico", host: "sknera-vpzbac3zaq.elasticbeanstalk.com", referrer: "http://sknera-vpzbac3zaq.elasticbeanstalk.com/"

我还查看了有关该主题的其他答案,但没有一个对我有帮助.

I also reviewed some other answer on that topic but none of them helped me.

推荐答案

看起来,静态内容PATH在您的代码中被硬编码为127.0.0.1.这就是为什么它在您的本地环境下运行良好的原因.

Looks like, the static content PATHs are hard coded to 127.0.0.1 in your code. That's why it was working fine in your local.

在代码中查找127.0.0.1的值,并将其替换为相对的PATH.

Look for 127.0.0.1 value in your code, and replace it with relative PATHs.

这篇关于Beanstalk 502 Bad Gateway Spring应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆