Trying to run Spring Petclinic application on an EC2 instance:
sudo yum install -y git
git clone https://github.com/spring-projects/spring-petclinic.git
cd spring-petclinic
./mvnw package
java -jar target/*.jar -Dserver.address=0.0.0.0
The application comes up fine and accessible at http://localhost:8080. But trying to access using the public IP address times out.
Already seen the recommendation at How to configure embedded Tomcat integrated with Spring to listen requests to IP address, besides localhost? and tried specifying server.address
in application.properties
, rebuilt and redeployed the application. How to setup spring-boot to allow access to the webserver from outside IP addresses is suggesting similar as well.
Not a recommended practice but EC2 instance security group is open for all inbound TCP traffic for all ports.
What else can be wrong?