Getting a redirect loop (301) on install

This is a new install of ghost, version 2.29.1. I’m running nginx as my ssl layer and proxy. The url is https://blog.sharpsoftware.dev .

My configuration is as follows

{
   "url": "https://blog.sharpsoftare.dev/",
   "server": {
     "port": 2368,
    "host": "127.0.0.1"
},
"database": {
"client": "sqlite3",
"connection": {
  "filename": "./content/data/ghost.db"
}
},
 "mail": {
"transport": "Direct"
 },
"logging": {
 "transports": [
  "file",
  "stdout"
]
},
 "process": "systemd",
 "paths": {
  "contentPath": "/home/website/blog/content"
}
}

Nginx configuration is

server {
listen 443 ssl;
listen [::]:443 ssl;

ssl on;
ssl_certificate         /root/blog.sharpsoftware.dev/fullchain.cer;
ssl_certificate_key     /root/blog.sharpsoftware.dev/blog.sharpsoftware.dev.key;

server_name blog.sharpsoftware.dev;
root /var/www/html;
index index.html index.htm index.nginx-debian.html;

location / {
    rewrite ^/route/?(.*)$ /$1 break;
    proxy_set_header Host $http_host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-NginX-Proxy true;

    proxy_pass  http://127.0.0.1:2368;
    proxy_redirect off;
    }
}

Which works with my other node servers.

The server works if I simply remove the “url” field in the config, but many of the links and images end up broken without that value so I’m trying to figure this out before I try to bring it online for real. I like ghost as I’ve used it before, but this issue has me stumped.

Additionally, there is no 301 redirect if I take down the ghost server and nginx shows the gateway failure as expected. If I connect directly to ghost locally, I still see the 301.

You’re missing the X-Forwarded-Proto header

See the default nginx template: