Fixing Ghost / Nginx Redirect Loops

In Ghost (0.7.4) if you try to deliver your whole website over TLS (a.k.a SSL) you often get a redirect loop as below:

Redirect loop in Nginx

To fix the problem you can simply add the following line to your Nginx location stanza for the vhost running ghost:

proxy_set_header X-Forwarded-Proto $scheme;