← Back to all fixes

ERR_TOO_MANY_REDIRECTS — redirect loop

The Issue

Opening the site gives "ERR_TOO_MANY_REDIRECTS" in the browser.

Root Cause

Usually happens when nginx redirects HTTP to HTTPS but the upstream app also redirects, or when the proxy_pass and server_name create a loop.

How to Fix
  1. Check your server blocks for conflicting redirect rules
  2. If using `return 301 https://...` in the HTTP block, make sure the HTTPS block does NOT also redirect
  3. Pass the scheme to the upstream app: `proxy_set_header X-Forwarded-Proto $scheme;`
  4. If your app redirects based on protocol header, trust the nginx forwarded header, not the raw connection
  5. Test with `curl -I http://yourdomain.com` and follow each hop to find where the loop starts