Tli*_*ink 6 java nginx spring-boot amazon-elastic-beanstalk
我已将一个简单的 Spring boot 应用程序部署到 Elastic Beanstalk,但当我尝试访问 /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 应用程序属性中设置了它,当它不起作用时,我在 EBS 中再次设置了它作为环境变量。但我仍然遇到同样的错误。也在SpringBootServletInitializer主类中使用,但这也没有帮助。
我还能尝试什么让它运行