Case study

ERR_TOO_MANY_REDIRECTS caused by incorrect NGINX redirects

A site was returning ERR_TOO_MANY_REDIRECTS after an NGINX change. The server was online, but conflicting redirect rules kept sending browsers between URL variants until they refused to continue.

Context

A business website started showing ERR_TOO_MANY_REDIRECTS after changes were made to the NGINX virtual host configuration.

The site was still online at server level, but visitors could not reach the application because NGINX kept redirecting requests between different hostname variants.

The problem

  • NGINX had overlapping redirect rules across separate server blocks.
  • Separate server blocks were redirecting the bare domain and www hostname back to each other.
  • The loop only involved hostname handling: one rule forced the bare domain, while another forced the www hostname.
  • The customer needed the site restored without changing application code or weakening the existing web server setup.

Our approach

  • Reviewed the active NGINX server blocks, includes and redirect rules rather than relying only on the browser error.
  • Tested each URL variant with headers to see exactly where requests were being redirected.
  • Simplified the configuration so only one rule selected the canonical hostname and all other hostnames redirected in one direction.
  • Validated the NGINX config, reloaded safely and documented the redirect pattern to avoid the same issue returning.

Practical outcomes

Site access restoredThe hostname redirect loop was removed and visitors could reach the site normally again.
Root cause identifiedThe issue was traced to conflicting NGINX hostname rules rather than DNS or the application itself.
Cleaner NGINX configRedirect handling was reduced to one predictable canonical hostname flow.
Safer future changesThe handover included validation commands and reload checks before future NGINX redirect changes go live.

Relevant technologies and keywords

These are the main technologies, services and search terms connected to this case study.

NGINXERR_TOO_MANY_REDIRECTSRedirect loopHostname redirectsCanonical hostServer blocksReverse proxyCanonical hostname301 redirectWebsite outage

Want help with a similar issue?

Send the symptoms, affected service, recent changes and business impact. We will suggest the most appropriate route: emergency support, a fixed-scope technical fix, an infrastructure review or a wider project.

Contact Us