Cannot GET / error when using real site url in config

We have a GHOST install running on a local IP behind NGINX proxying and serving SSL. If I put the real site URL in config, GHOST gives the “Cannot GET /” error:

{
  "url": "https://mydomain.com/blog",
  "server": {
    "port": 2368,
    "host": "10.10.10.1"
  },

If I put the local IP and port in config, GHOST runs and serves pages, but many things are broken (e.g. email invitations contain the wrong URL)

{
  "url": "http://10.10.10.1:2368",
  "server": {
    "port": 2368,
    "host": "10.10.10.1"
  },

Any idea what goes wrong?

change host with 127.0.0.1

{
  "url": "https://mydomain.com/blog",
  "server": {
    "port": 2368,
    "host": "127.0.0.1"
  },

Make sure your location block looks like below within your nginx server block

location /blog/ {
    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 $http_host;
    proxy_pass http://127.0.0.1:2368;
}

Restart nginx

& It should work properly

1 Like