HTTPS and ERR_TOO_MANY_REDIRECTS

From documentation:

Enter the URL that is used to access your publication. If using a subpath, enter the full path, https://example.com/blog/ . If using SSL, always enter the URL with https:// .

My ghost config:

“url”: “https://site.ru/”,
“server”: {
“host”: “127.0.0.1”,
“port”: 8000
}

Nginx config:

location / {
proxy_set_header Host $host;
proxy_pass http://127.0.0.1:8000;
proxy_http_version 1.1;
}

And now on front-end always error: ERR_TOO_MANY_REDIRECTS

Maybe in the ghost config should specify the http protocol?

fix: proxy_set_header X-Forwarded-Proto $scheme;

2 Likes

I’m having this issue as well but the X-Forwarded-Proto was already set correctly. Ports match nginx and ghost config… I’m starting to lose my mind.

3 Likes

I’m also getting this when hosting my domain with Route53 and siphoning requests through a CloudFront distribution.

I am having this issue in heroku, deployed using the following heroku button: GitHub - SNathJr/ghost-on-heroku: One-button Heroku deploy for the Ghost 3.2.0 blogging platform.. How can I fix this in heroku?

I had this issue because when adding a redirect from www to the naked domain I had incorrectly added a line redirecting from naked domain to naked domain in the file mywebsite.com.conf in /etc/nginx/sites-available when configuring SSL. This resulted in an infinite redirect loop.

Updating this and then confirming the config change with sudo nginx -t and reloading with sudo nginx -s reload resolved it. I am using cloudflare so I also switched off proxies, switch on development mode, purged the cache and even after clearing cookies and browser cache I wasn’t able to view the site only in incognito would it show again. I’ll wait a bit for it to show again in the browser but I’m fairly satisfied that this is now resolved.