Spring Boot Application deployed on Elastic Beanstalk Java environment returns 502

后端 未结 3 502
太阳男子
太阳男子 2021-01-04 01:52

I\'m trying to deploy a very simple Spring Boot application on AWS Elastic Beanstalk using AWS\'s Java configuration (not their Tomcat configuration), but I keep getting a 5

相关标签:
3条回答
  • 2021-01-04 02:27

    From your question description and the security group settings you send me your only inbound Port 80 for your EC2 instance was open to world through firewall and you were using port 5000 for your application. So using the security rule that I gave you it opened the inbound port 5000 too for your EC2 instance so your application started working without above error.

    0 讨论(0)
  • 2021-01-04 02:33

    Nginx doesn't know on which port your spring boot applicaiton is running. Make application run on port 5000 that Nginx redirects to by default by adding "server.port=5000" to application.properties or other suggested ways in the last step:

    https://pragmaticintegrator.wordpress.com/2016/07/12/run-your-spring-boot-application-on-aws-using-elastic-beanstalk/

    0 讨论(0)
  • 2021-01-04 02:37

    If somebody is still getting such error, after setting server.port=5000. Here's what you can do if you got db connectivity:

    1. In configuration section of your dashboard, go to RDS section and create a remote db. Remember username, password of formed db.

    2. In Software section, add following properties:

    SPRING_DATASOURCE_URL=jdbc:mysql://(your-db-url)/ebdb

    SPRING_DATASOURCE_USERNAME=(username)

    SPRING_DATASOURCE_PASSWORD=(password)

    SPRING_JPA_HIBERNATE_DDL_AUTO=update

    SPRING_JPA_DATABASE_PLATFORM=org.hibernate.dialect.MySQL5Dialect

    0 讨论(0)
提交回复
热议问题