nginx -t passing does not guarantee the site is accessible. We once had a site-wide outage: syntax checks passed completely, but precise location-based 301 redirects and try_files directives mutually redirected, causing browsers to immediately report "Too many redirects." This tool gives you two things: an nginx configuration skeleton (with pitfalls documented in comments), and a real HTTP self-check script (which validates not just syntax, but also HTTP status codes and redirect counts).
One per line. The homepage is mandatory; at least one for each secondary page.
—
—
1 · Exact location + 301 causes an infinite loop.Write a location = /path { return 301 …; }, while try_files It internally redirects the request back to the same location, causing the browser to report "Too many redirects" and making the entire site inaccessible.nginx -t Cannot be fully detected.
2 · Long cache + no versioning = changes “appear ineffective”We’ve fallen into the same pit three times (CSS twice, JS once). The rule is simple:If expires is set, it must also be applied to CSS/JS ?v=; change once, upgrade once.
3 · <base href> must appear before all relative resources.written in <link> Afterward, secondary pages parse CSS into incorrect directories, causing styles to silently fail—this is completely invisible on primary pages.
4 · Don’t place backend data behind basic auth for fetch usage.Browsers’ credential caching for subrequests is uncontrollable, causing the page to hang forever on “Loading…”. Switch to “page login + data with secret-key parameter”.
5 · Local proxy triggers false alarms.Always add this to check if the site is online. --noproxy '*'; We once misclassified a proxy-returned 410 as “site down”, when it was actually 200.