skip to Main Content

I have a Spring boot project which I want to host on an AWS-EC2 instance. I was able to create its image using Git-hub, Jenkin and docker. I was also able to successfully pull and run this image in the Linux console of my AWS-EC2 instance.

According the tutorial I was following I should have been able to open the project now using the public IPv4 DNS but the response I got was that it refuse to connect.

I know that this usually has to do with Inbound rules so I added a rule to allow all traffic but it didn’t help.

For anyone who wants to know:
Git-hub repository: https://github.com/SalahuddinShayan/telecom
Docker-Hub repository: https://hub.docker.com/repository/docker/salahuddinshayan/telecom
Command I used to run the image in AWS:

docker run -p8081:8081 --name final-app --link docker-mysql:mysql salahuddinshayan/telecom  

Security Groups:enter image description here

Networking Details:
enter image description here

Here is the Error:enter image description here

I am completely stumped by it. Does anyone an idea on what to do to fix this?

2

Answers


  1. Please check if your client is calling the right protocol, e.g. http vs https.

    Login or Signup to reply.
  2. You are transmitting on port 8081. http://3.110.29.193:8081/ works fine from the EC2 side. 404 status is raised, so this is a client side error, not a server side error.

    It means that no firewall is blocking traffic and a process (your app) was found that listens on IP:Port that you require. The problem is that the process it encountered (your app) is sending only a WhiteLabel Error Page, which is a generic Spring Boot error page that is displayed when no custom error page is present. So the issue is with the Spring app itself and not with EC2 or with connection. In other words: the traffic can reach your Spring app, but your Spring app has nothing to say in response.

    As a side note, after deploying your app I would advise to refine the inbound traffic rules to allow only the traffic you want. There is no need of allowing all traffic on all ports.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search