首页 > 解决方案 > 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主类,但这也无济于事。

我还能尝试什么让它运行

标签: javaspring-bootnginxamazon-elastic-beanstalk

解决方案


推荐阅读