1

I have a domain through GoDaddy, and set it up to forward to my app on heroku (I was using forwarding with masking). This was working great, until I tried to add an A-record to enable forwarding from a naked URL. Now, when I go to my site, I get a blank page, and the error message:

Refused to display 'myherokuurl' in a frame because it set 'X-Frame-Options' to 'SAMEORIGIN'.

And the source code in dev tools is a frame src. I have no idea why. I deleted the extra A-record that seems to have caused this problem almost 48 hours ago (so I don't think DNS propagation is an issue anymore). This is how I currently have everything set up in the DNS zone in GoDaddy:

My A records: enter image description here

My CNAME: enter image description here

And I have forwarding with masking set up to go to my heroku URL.

I also notice that when I run host www.mysiteurl.com, I get www.mysiteurl.com is an alias for mysiteurl.com.

Isn't that supposed to be www.mysiteurl.com is an alias for http://myherokuapp.herokuapp.com?

I'm using Cedar 14 stack on Heroku, and have read that A-records don't play nicely with that, so I'm tempted to delete my A-record and just go with what I have in the CNAME, but I'm afraid I'll further screw things up.

I really don't know what to do and am at the end of my rope with this. If anyone could offer any piece of advice or guidance, I'd really appreciate it.

tx291
  • 1,251
  • 6
  • 24
  • 42

2 Answers2

0

So it looks like the key issue to solving this was to remove the "forwarding with masking" option from GoDaddy--that's what broke everything, despite their telling me that the DNS was just updating and I needed to wait 48 hours -_-

My only issue now is just that the heroku url appears in my browser when I land on my site!

tx291
  • 1,251
  • 6
  • 24
  • 42
0

You just have to enable IFrame support, by adding this to your application.rb file:

class Application < Rails::Application
  # ...
  # ...
  # insert here the following code:

  config.action_dispatch.default_headers = {
  'X-Frame-Options' => 'ALLOWALL'
  }
end

Then push to Heroku, the error message and blank page should disappear to show your page normally.

Guillaume Bihet
  • 625
  • 1
  • 9
  • 17