502 AWS Spring Boot应用程序上的错误请求 [英] 502 bad request on AWS Spring boot application

查看:114
本文介绍了502 AWS Spring Boot应用程序上的错误请求的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是新的AWS,正在尝试在Elastic Beanstalk中部署spring boot应用程序.部署成功,但无法访问应用程序.收到502 Bad Request Gateway nginx/1.10.1错误.部署在配置上完成 运行Java 8(nginx代理服务器)的64位Amazon Linux 2016.09 v2.2.0.有什么办法可以解决这个问题.谷歌搜索后,我发现是由于端口不匹配.我想知道应该在哪里更改端口号.

Hi I am new AWS and trying to deploy spring boot application in Elastic Beanstalk . Deployment is successful but not able to access application .Getting 502 Bad Request Gateway nginx/1.10.1 error. Deployment is done on Configuration 64bit Amazon Linux 2016.09 v2.2.0 running Java 8 (nginx proxy server). Is thier any way to solve this issue. After doing googling i found it is because of port mismatch.I wanted to know where i should change the port numbers.

推荐答案

从AWS

默认情况下,Spring Boot应用程序将在端口8080上侦听.Elastic Beanstalk假定应用程序将在端口5000上进行侦听. 有两种方法可以解决此差异:更改端口Elastic Beanstalk配置为使用或更改Spring Boot的端口 应用程序监听.

By default, Spring Boot applications will listen on port 8080. Elastic Beanstalk assumes that the application will listen on port 5000. There are two ways to fix this discrepancy: change the port Elastic Beanstalk is configured to use, or change the port the Spring Boot application listens on.

您可以在端口application.propertiesserver.port属性中设置端口,或通过设置SERVER_PORT环境属性来通过上述文档中所述的环境来设置端口.

You can set the port in server.port property in application.properties or set it through environment as described in the document referred above by setting SERVER_PORT environment property.

这篇关于502 AWS Spring Boot应用程序上的错误请求的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆