A redirect loop, a repeated 301/302 chain of URLs in the browser or a rewritten URI within NGINX, is revealed. Consider HTTPS, www, reverse proxy, application URL, and rewrite flags together.
2026/07/17 04:11:31 [error] 2418#2418: *1411 rewrite or internal redirection cycle while internally redirecting to "/index.php"
HTTP/2 301
location: https://example.com/
The browser is stuck in a redirect loop with the client going back and forth between URLs with sequential 3xx responses. An internal redirection cycle is when NGINX re-maps the same URI again within location/rewrite operations.
Canonical redirects such as HTTP→HTTPS and www→non-www should be done in one open rule. If a server block redirects www to, and an application redirects non-www to www, an infinite loop occurs.
The application behind the reverse proxy may not see the actual client schema. If X-Forwarded-Proto is not properly forwarded, the application may redirect the HTTPS request to HTTPS again thinking it's an HTTP request.
Cloudflare Flexible SSL uses HTTPS between the visitor and Cloudflare, but HTTP between Cloudflare and the origin. If the origin has forced HTTPS redirection, a loop can occur.
NGINX rewrite module re-examines the location search when the URI changes and is limited by a cycle. An incorrect last, try_files, or error_page target at the end can cause a 500 internal cycle error.
301 responses can be cached by browsers and CDNs; in correction tests, first view the chain with curl, and use temporary 302 if necessary.
Search for the phrase you see in the email, browser, or SSH log. Each card includes meaning, probable cause, and safe initial action.
Meaning: Browser followed a large number of external redirects.
Possible cause: HTTP/HTTPS, www, application, or proxy rules are conflicting.
Meaning: NGINX is processing the same URI repeatedly in internal redirects.
Possible cause: Incorrect rewrite last, try_files or error_page target.
Meaning: Browser general redirect loop message.
Possible cause: Server, application, CDN, or cookie-based redirection.
Meaning: Permanent redirection generates two reciprocal URLs.
Possible cause: www/non-www or slash policy conflict.
Meaning: Origin and proxy scheme information do not match.
Possible cause: X-Forwarded-Proto missing or Flexible SSL.
Meaning: The error page is reproducing the same error itself.
Possible cause: error_page target is unavailable or redirects to the same location.
Meaning: WordPress home/siteurl is different from NGINX canonical.
Possible cause: HTTP/HTTPS or www incompatibility.
Meaning: Browser upgrades HTTP to HTTPS without accessing NGINX.
Possible cause: Pre-sent sent HSTS policy.
No records matching this expression were found.
Commands are for root access. Collect only status and logs first; Do not change the permanent setting without seeing the reason.
curl -skIL --max-redirs 15 https://example.com/ | grep -Ei 'HTTP/|location:'
Displays each 3xx step and the target URL.
nginx -T | grep -nE 'server_name|return 30[1278]|rewrite |try_files|error_page|X-Forwarded-Proto'
It lists the effective directives that can create a loop.
curl -skI https://example.com/
curl -skI --resolve example.com:443:ORIGIN_IP https://example.com/
Separates the CDN or reverse proxy layer.
grep -R 'rewrite or internal redirection cycle' /var/log/nginx 2>/dev/null | tail -n 50
Internal cycle finds target and request.
wp option get home --path=/var/www/example
wp option get siteurl --path=/var/www/example
Application compares canonical URL with NGINX.
nginx -t && systemctl reload nginx
curl -skIL --max-redirs 10 https://example.com/
Verification of the chain being terminated after the fix.
Although the root cause of the NGINX error is the same, package paths, service names, security layers and virtual host management vary depending on the Linux distribution or Plesk infrastructure used.
NGINX Too Many Redirects Solution for Systemd, Package Path, and Journald Controls
curl -skIL --max-redirs 15 https://example.com/
nginx -T | grep -nE 'return 30|rewrite |X-Forwarded-Proto'NGINX Too Many Redirects Solution for SELinux, PHP-FPM Pool, and RHEL-Based Service Controls
curl -skIL --max-redirs 15 https://example.com/
nginx -T | grep -nE 'return 30|rewrite |X-Forwarded-Proto'NGINX virtual host files generated by Plesk: nginx too many redirects check.
grep -R 'return 30\|rewrite ' /var/www/vhosts/system/example.com/conf 2>/dev/null
plesk repair web example.com -nDistinguish the NGINX internal cycle problem with the external 3xx chain and create a single canonical URL and correct proxy scheme.
Record each 301/302's source and target URL.
curl -skIL --max-redirs 15 https://example.com/ | grep -Ei 'HTTP/|location:'Find where the loop starts by sending a direct request to the Origin IP.
curl -skIL --resolve example.com:443:ORIGIN_IP https://example.com/Apply the HTTPS and www preference only in a single open server block.
nginx -T | grep -nE 'server_name|return 30'The backend application should see the correct client schema.
nginx -T | grep -n 'X-Forwarded-Proto'Verify that try_files, error_page, and rewrite last targets are not being directed to the same location.
grep 'redirection cycle' /var/log/nginx/error.log | tail -n 20Curl, hidden window, and CDN cache purge are used to verify the chain when necessary.
nginx -t && systemctl reload nginx
curl -skIL --max-redirs 10 https://example.com/Origin scheme and X-Forwarded-Proto may not match.
curl -sIL http://example.com/; curl -skIL https://example.com/The application might choose a different canonical host with NGINX.
curl -skI https://www.example.com/; curl -skI https://example.com/If HTTPS origin is forced, a transition to Full/Strict mode and certificate verification is required.
Compare the Location values of Origin and Cloudflare requests.home/siteurl, SSL proxy header and cookie domain are checked.
wp option get home; wp option get siteurlrewrite last, try_files or error_page are redirecting the same URI.
grep 'redirection cycle' /var/log/nginx/error.log | tailApplication may conflict with NGINX's trailing slash policy.
curl -skIL https://example.com/yol; curl -skIL https://example.com/yol/This occurs due to the application, CDN, reverse proxy, or www/non-www redirection rules being mutually contradictory.
No. Internal cycle NGINX is URI reprocessing inside NGINX; browser loop is a sequential 3xx response seen on the client side.
Flexible SSL sees origin HTTP while origin redirects to HTTPS, Cloudflare reconnects with HTTP and a loop may occur.
Reverse proxy, sends the client's original HTTP/HTTPS scheme to the backend application; otherwise, the application may produce unnecessary HTTPS redirects.
Inspect the header chain using curl, use a private window, and if necessary, clear the CDN cache. A temporary 302 is safer during testing.
home/siteurl, proxy SSL header, www preference and NGINX HTTPS redirection should be adjusted to the same canonical URL.
A loop may occur if the URI changes but still matches the same location and rewrite rule; break or return might be more appropriate.
By analyzing cPanel, WHM, CloudLinux, LiteSpeed, MariaDB, Exim and security layers together, we fix the root cause of the failure instead of just removing the service.