Ghost + NGINX: How to fix ERR_TOO_MANY_REDIRECTS error

Learn how to fix ERR_TOO_MANY_REDIRECTS error in your Ghost + NGINX config

Ghost + NGINX: How to fix ERR_TOO_MANY_REDIRECTS error

If you had setup a custom NGINX server for your Ghost blog and you are getting the ERR_TOO_MANY_REDIRECTS error keep reading to learn more about how to fix it and why happens

Cause 🤓

Usually it happens when you installed Ghost with a custom NGINX server and try to login into the Ghost admin due the NGINX config

The Ghost admin is available on your blog URL adding /ghost but it requires to access via HTTPS expecting the correct X-Forwarded-Proto header so just update your NGINX config for it.

How to fix it ✅

Edit your NGINX config file, usually located at /etc/nginx/nginx.conf

Then add or edit the next block for /ghost path

location ^~ /ghost {
  proxy_set_header X-Forwarded-Proto $scheme;
  proxy_set_header X-Real-IP $remote_addr;
  proxy_set_header HOST $host;
  proxy_set_header X-NginX-Proxy true;
  proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  proxy_pass http://<IP>:<PORT>;
}

⚠️ Update <IP> with your blog server IP and <PORT> with the port where Ghost is installed and running.

💡 Usually IP is 127.0.0.1 is it's the same server and the port is 2368 if you didn't change it

Then restart the NGINX process in your system.

💡 If your server is running Ubuntu 18 just run sudo systemctl restart nginx

Write your Ghost blog success 🚀

Give a try to Ghostboard without any risk: start now your 14 days free trial without credit card, check it out by yourself 🙂

Ghostboard.io

Happy to help you and answer any question, tweet us or contact in your dashboard! 👋