1

I set up a DNS masking for my GoDaddy domain so that my Amazon EC2 url wouldn't be shown to the user. Instead of the original index.html returned by Nginx the user now gets it wrapped in some GoDaddy stuff:

<head>
  <title>My Home</title>
  <META name="description" content="Blah blah."><META name="keywords" content="Blah, blah">
</head>
<frameset rows="100%,*" border="0">
  <frame src="http://ec2-xx-xxx-xxx-xx.us-west-2.compute.amazonaws.com" frameborder="0" />
  <frame frameborder="0" noresize />
</frameset>

The ultimate problem is that this seems to break my HTML meta viewport setting in the original index.html and the page is incorrectly rendered on mobile devices. Of course the setting is still there somewhere, but browsers seem to ignore it probably due to that frame thing.

How can I fix this? I don't know if I'm even doing this setup correctly as I'm a complete novice in this stuff :)

user2061057
  • 113
  • 3
  • Do you even want to use an iframe? Why not let DNS resolve to the IP of your EC2 instance? This looks like a ver long way around. Perhaps explain what you are trying to achieve, rather than focus on this particular problem. – JayMcTee Apr 07 '16 at 16:23
  • I'm just trying to hide the EC2 address from the browser and show my domain name instead. After some googling I guess the CNAME setting should do it? – user2061057 Apr 08 '16 at 10:09
  • First get an elastic IP in your AWS account. Then indeed resolve the domain name to that IP. No iframes needed! – JayMcTee Apr 08 '16 at 10:10
  • Now that I removed the framing my browser says "This website is temporarily unavailable, please try again later. ", but when I refresh it goes to the EC2. Why is this? I cleared the cache but it didn't help. – user2061057 Apr 08 '16 at 10:11
  • I get "This website is temporarily unavailable, please try again later. " every time I go to my domain. – user2061057 Apr 08 '16 at 10:12
  • DNS has some propagation time. Your ISP needs to know about the change first, this can take a few hours. You can force the change locally by editing your computer's host file. Point the domain to the new IP and it should work. This overrides global DNS locally. – JayMcTee Apr 08 '16 at 10:17
  • Well, thanks :) I'm still a bit confused...in GoDaddy should I set redirection or just modify CNAME in DNS settings? Should I make my domain use AWS's nameservers? – user2061057 Apr 08 '16 at 10:44
  • I think I now got it working by removing all forwardings in GoDaddy and just set the A record in DNS settings to point to the AWS elastic IP. Thanks for your help! – user2061057 Apr 08 '16 at 11:05
  • Good, yes, no redirect stuff, just straight up DNS. – JayMcTee Apr 08 '16 at 11:17

1 Answers1

1

It seems you simply want to have your domain name resolve to your EC2 instance. What you are attempting now is a convoluted long away around to achieve this. Your current way will hurt you in rankings etc.

What you probably really want is:

  • Create en elastic IP in your AWS account
  • Attach this elastic IP to your EC2 instance
  • In GoDaddy configure your domain name DNS to this IP address, an A record should be fine
  • Remove redirects etc. from GoDaddy, just use plain DNS means
  • Wait for DNS to propagate, can be a few hours
  • Remove your iframe, just build normal HTML pages.
JayMcTee
  • 3,763
  • 12
  • 20