What the message looks like
2026/10/29 09:14:02 [error] 1234#1234: *5678 rewrite or internal redirection cycle while internally redirecting to "/index.html", client: 203.0.113.5, server: example.com, request: "GET /app/ HTTP/2.0"Common causes
try_files $uri $uri/ /index.html;but/index.htmldoes not exist in theroot(build missing, wrong path).- The
rootor analiaswas changed and no longer points to the deployed site. - The
indexfile named in the config is not there. - A
locationorrewriterule sends the request back into itself. - A single-page app was deployed without its
index.html.
Check
- The effective rules for this site
nginx -T 2>/dev/null | grep -nE 'server_name|root |alias |try_files|index ' - Does the fallback file exist?
ls -l /var/www/app/index.html - The exact log lines
tail -n 20 /var/log/nginx/error.log - Is the configuration valid?
nginx -t
Fix
- Point
rootto the directory that really containsindex.html. - Make sure the build was deployed and
index.htmlis there and readable by nginx. - For a single-page app use
try_files $uri /index.html;and nothing that falls back to a path that again falls back. - With an
alias, check the trailing slashes and thattry_filesuses a path inside it. - Reload:
nginx -t && systemctl reload nginx.
FAQ
Why 500 and not 404?
nginx stops after 10 internal redirects and reports a server error, because the loop is a configuration problem, not a missing page.
Can the same message come from a rewrite rule?
Yes. A rewrite without last, break or a clear exit condition can also loop. Check each rewrite in the matching location.