Nginx – Problems with GoDaddy DNS masking and html viewport

amazon-web-servicesdomain-name-systemgodaddyhtmlnginx

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 🙂

Best Answer

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.
Related Topic