502 错误网关 Elastic Beanstalk Spring Boot [英] 502 bad gateway Elastic Beanstalk Spring Boot
问题描述
我在 AWS Elastic Beanstalk 上部署了一个 Spring Boot 应用程序.我正面临 502 Bad Gateway 错误.我从日志中找不到任何有用的东西
I deployed a Spring Boot app on AWS Elastic Beanstalk. I am facing a 502 Bad Gateway error. I cannot find anything useful from the logs
/var/log/nginx/error.log
/var/log/nginx/error.log
2019/02/10 02:12:54 [error] 3257#0: *1 connect() failed (111: Connection denied) while connected to upstream, client: ...., server: , request: "GET/HTTP/1.1", 上游: "http://127.0.0.1:5000/", 主机:……"
2019/02/10 02:12:54 [error] 3257#0: *1 connect() failed (111: Connection refused) while connecting to upstream, client: ...., server: , request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:5000/", host: "...."
我没有任何用于前端的 html 文件.我只想上传部署 api 以共享来自 swagger ui 的文档.
I do not have any html files for front-end. I just want to upload deploy the api to share the documentation from swagger ui.
推荐答案
这是因为服务器正在侦听 5000,将server.port=5000"添加到 application.properties 解决了该问题.
It's because server is listening to 5000, Adding "server.port=5000" to application.properties fixed the issue.
这篇关于502 错误网关 Elastic Beanstalk Spring Boot的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!