502 bad gateway Elastic Beanstalk Spring Boot

A.Dev :

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

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: "...."

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.

A.Dev :

It's because server is listening to 5000, Adding "server.port=5000" to application.properties fixed the issue.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=145784&siteId=1