Case study
Case Study: ERR_TOO_MANY_REDIRECTS caused by incorrect NGINX redirects
This example shows how a production infrastructure problem can be investigated methodically, improved safely and turned into clearer operational practice.
Context
A organisation 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
wwwhostname back to each other. - The loop only involved hostname handling: one rule forced the bare domain, while another forced the
wwwhostname. - 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.
Hands-on outcomes
Relevant technologies and keywords
These are the main technologies, solutions and search terms connected to this case study.
Related solutions
Relevant solutions for similar infrastructure problems.
Want assist with a similar issue?
Send the symptoms, affected system, recent changes and organisation impact. We will suggest the most appropriate route: emergency engineering assistance, a fixed-scope engineering fix, an infrastructure review or a wider project.