Refused to display in a frame because it set 'X-Frame-Options' to 'sameorigin'

I was having this same problem (right now, with up-to-the-moment Ghost and Discourse), and fixed it by changing the Discourse site, not the parent Ghost site.

And it was a struggle to get rid of the x-frame-options headers coming from Discourse! I ended up with this in my Nginx site configuration:

location / {
        proxy_pass http://unix:/var/discourse/shared/standalone/nginx.http.sock:;
        proxy_set_header Host $http_host;
        proxy_http_version 1.1;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto https;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_hide_header 'x-frame-options';
        add_header x-frame-options ALLOWALL;