Issue
I have a website that I have hosted on an EC2 instance that runs on port 3000. (e.g. 3.27.83.19:3000
- assuming the IP address of the EC2 instance is 3.27.83.19
)
I have a domain that I have already bought mydomain.com
through AWS that I already see in Hosted Zones.
How can I set-up Route53 so that when someone hits "mydomain.com", it takes them to 3.27.83.19:3000
rather than 3.27.83.19
Thanks!
Solution
point domain to instance ip
To point example.com
to 3.27.83.19
you simply need to create an A
record in route53
point domain to load balancer
To access the website running port 3000 on an EC2 instance through https://example.com, you need a service that accepts traffic on https://example.com and then forward the traffic to the EC2 instance on port 3000
. You can easily do it with an AWS application load balancer. I like this approach.
There are many benefits using an application load balancer. The important one is that you can configure the SSL certificate easily. The application load balancer also supports host based routing which allows you to host multiple websites.
If you are looking for less expensive solutions, you can also go for setting up an nginx proxy inside the ec2 instance. I personally don't like this approach because you will need to configure SSL at the application level.
https://aws.amazon.com/premiumsupport/knowledge-center/public-load-balancer-private-ec2/
Hope this helps.
Answered By - Arun Kamalanathan