java - AWS Elastic Beanstalk:502 Bad Gateway nginx/1.14.1 Spring boot application - 尝试端口 5000
问题描述
我已经为 Elastic Beanstalk 部署了一个简单的 Spring 启动应用程序,但是当我尝试访问 /serviceinfo 或任何用于此目的的路径时,它总是显示Health
Degraded
在仪表板中我收到此错误 502 Bad Gateway nginx/1.14.1
该应用程序在本地运行
但是在 EBS 日志上我读到:
2019/03/02 06:55:49 [error] 3298#0: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 111.215.59.25, server: , request: "GET /serviceinfo HTTP/1.1", upstream: "http://127.0.0.1:5000/serviceinfo", host: "myservice.us-east-1.elasticbeanstalk.com"
因为我过去部署了其他 Spring Boot 应用程序,所以我知道server.port=5000
,我已经在我的 Spring Application 属性中设置了它,当它不起作用时,我在 EBS 中再次设置了它作为环境变量。但我仍然得到同样的错误。也用于SpringBootServletInitializer
主类,但这也无济于事。
我还能尝试什么让它运行
解决方案
推荐阅读
- android - 从另一个片段返回时保留片段内的对讲焦点?
- google-cloud-platform - 将 Google Cloud Platform 服务帐户的访问权限限制为特定的 Gmail 帐户
- javascript - 如何使用 react-hook-form 在 React 中存储无线电组的状态
- javascript - HTML5 / JavaScript / JQuery - 获取与输入相关联的表单的最佳方式
- search - 如何匹配特定列中的精确文本并输出整行信息?
- r - 如何使用 R 从数组中选择行?
- chart.js - 如何限制chart.js中显示的点数?
- php - 我的 Ajax 不显示通知消息
- php - 如何声明在 PhpDoc 中定义了一个常量(用于 intelephense)?
- string - string.Contains 函数在我的 golang 代码中没有按预期工作。虽然第一个字符串包含第二个字符串,但条件失败