Pointing Domain name to AWS EC2

0

I have a domain name (Eg: www.myurl.com) and my website is running in an Elastic Beanstalk instance on AWS EC2.

I have created a hosted zone and made all the entries for pointing my domain to my EC2 instance.

Everything works fine, but the only problem is , when I hit my domain url (www.myurl.com) , the website loads from EC2 but the url also changes to the EC2 url, something like (http://someec2.url.aws.com)

How can I keep my url (www.myurl.com) in the browser, while the website still loads from ec2 and restrict to show the ec2 url.

Quick response is appreciated.

Thanks in advance.

Sumit Rathore

Posted 2017-06-23T19:27:54.337

Reputation: 1

I'm reasonably sure that if you search this site, you'll find your answer. If you inspect your HTTP response headers and your web server access logs, you'll also find that your server is actually triggering this behavior. – Michael - sqlbot – 2017-06-24T00:40:46.473

Answers

0

I think you are doing a redirection somewhere

Make sure your Route 53 is authoritative for your zone. Which means you need to go to your registrar and make sure you put the DNS servers as the ones from Route 53.

Once you have done that, make sure you create a CNAME (or A record) on Route 53 and point it to your EC2 name (or IP address).

Algeriassic

Posted 2017-06-23T19:27:54.337

Reputation: 723

Hi, Thanks for responding. I did checked all the configs, but I am still stuck. Here is the configs that I have :- <br>

NS records (Nameservers_ - All pointing to AWS servers <br>

SOA record - Pointing to AWS default <br>

A record - www.mysite.com ( pointing to the ip address on my EC2) <br>

A record - an alias record for (mysite.com) pointing to existing A record ((www.mysite.com) <br>

CName - I tried creating a cname record instead of A-record, but it also didn't work

<br> But still when I hit my website (www.mysite.com) , the url in browser changes to (myec2 url) . – Sumit Rathore – 2017-06-25T23:24:54.240

No need to do anything with SOA. Can you share what this command's output? nslookup www.mysite.com nslookup mysite.com – Algeriassic – 2017-06-27T16:22:23.353

0

Thanks for responding. I did checked all the configs, but I am still stuck. Here is the configs that I have :-

NS records (Nameservers_ - All pointing to AWS servers

SOA record - Pointing to AWS default

A record - www.mysite.com ( pointing to the ip address on my EC2)

A record - an alias record for (mysite.com) pointing to existing A record ((www.mysite.com)

CName - I tried creating a cname record instead of A-record, but it also didn't work
But still when I hit my website (www.mysite.com) , the url in browser changes to (myec2 url) .Am I still missing something.

Sumit Rathore

Posted 2017-06-23T19:27:54.337

Reputation: 1

No need to do anything with SOA.

Can you share what this command's output?

nslookup www.mysite.com nslookup mysite.com – Algeriassic – 2017-06-26T20:04:04.797