Reputation: 153
I was wondering how can I redirect a domain name to one of my EC2 instances in AWS.
The domain name is registered in Route 53 and I have already associated it with the instance.
If I access the domain in the URL it shows the default apache2 page.
I want to redirect the domain name www.xyv.com
to my application at the URL http://ec2-52-63-222-150.sa-east-1.compute.amazonaws.com:8080
.
How can I do that?
Upvotes: 0
Views: 4181
Reputation: 873
Depending on your situation, you may also configure your IPTABLES to redirect all traffic coming at port 80 to port 8080. (NAT table) - be noted that this redirects all traffic or from a specific source. for example, if your instance is in a private subnet, you have no public IP, and only the IP address of your jump server. You need to redirect all traffic at jump server to your instance in the private subnet. But, again, this all depends on your situation. that was only an option.
Upvotes: 0
Reputation: 269490
DNS can only redirect the domain name of your URL. Basically, it converts a Domain Name into an IP address.
By default, web traffic is accessed on port 80. However, your application is running on port 8080. Therefore, you can access it via www.xyv.com:8080
.
If you do not want to specify a port, you have two choices:
Both of these options require changes to your web server configuration.
Upvotes: 4