View Site gives "refused to connect"

Hello
I have just installed ghost on my web server and except for one smaller issue it appears to be working well. I can make posts, view them and so on. The small issue is that the site preview at “View site” does not work. Here is a screenshot: https://imgur.com/guTfM4w
What can I do to fix this?

Thank you.

Machine: raspberry pi 4 with raspbian
url: https://ghost.heuristics.art/
Ghost-CLI version: 1.13.1
Ghost version: 3.15.2 (at /var/www/ghost)
Browsers tested: chrome&brave
No errors seen in console or error log file
Not sure how to reproduce
my config files: https://textuploader.com/1c6ej

This might be down to your X-Frame-Options, which can prevent your site from appearing in an iframe (which is what this view uses). You can change the value to SAMEORIGIN which will allow Ghost admin to load your site. More details can be found on MDN:

Hope this helps! :blush:

Thank you. I think this is the right solution. It made it work in brave on ios and chrome on windows. Brave on windows claims that the x-frame-options are still wrong however, I find that weird, looking at the source with curl -v it looks like it gets set right. Maybe I have a caching issue.

I had previously not tried ghost in microsoft edge, I did now and noticed that the admin (/ghost) page wont load there, just infinite loading wheel, maybe it’s a know bug? (not important for me, I don’t use edge)

Anyway, thank you.

Edit ------
Cleared brave cache, it works now. (i’m happy :slight_smile: )

1 Like

I followed the instructions given and added to my nginx config file at system/files/nginxconfig.file under ghost home folder.

location / {
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header Host $host;
    add_header X-Frame-Options SAMEORIGIN always;        <<<<<<<<

after restart of nginx, no changes in effect.

did i miss any steps …?