Welcome to part 8 of tutorial series on Flask application with EC2 instance. In the previous tutorial, we have covered on the creation of elastic IP and why it is essential. As promised, in this tutorial I will take you through on how to route domain traffic to our flask application hosted on an EC2 instance.

Assuming, you have the domain (free or purchased). I will be using srcecde.com registered with GoDaddy. We will start by logging into the domain name registrar. In my case it’s GoDaddy. Once you are logged in, navigate to the DNS Management panel. It will look something like this.

route traffic from domain to ec2

Further, we will click on ADD. In the Type select, A. Host will be @. In Points to, we will put our EIP and click on Save.

route traffic from domain to ec2

It will take some time to reflect. You can keep trying to visit the domain. In my case, I’ll visit srcecde.com and you will be able to see the application is working fine. Hence, all the domain traffic is not hitting our flask application running on an EC2 instance.

route traffic from domain to ec2

Please refer below video tutorial for more.


What if you want to run multiple flask application on a single EC2 instance? That’s something we will cover in the upcoming tutorial. In a mean time refer my YouTube channel for more tutorials. Keep sharing and stay tuned for more. Follow me on Twitter