Debug HTTP Checks Behind Nginx Without Falling Back to TCP
Sources and verification
- Source dates
- Oldest source check: 12 September 2026.
- Technical verification
- Separate technical verification has not been recorded.
Publication approval and technical verification are recorded separately. Automated link checks establish reachability, not accuracy. A checked example verifies only its stated test cases, not the whole article or your production setup.
In short
Compare the failing HTTP probe with an equivalent request from the same network, preserving hostname, TLS SNI, method, headers, and redirect behavior. Find the first layer that differs using proxy and origin logs. Keep an application-level assertion after fixing the path. A successful TCP connection only proves a listener accepted a connection; it does not repair a failed HTTP check.
Key takeaways
- An equivalent network location is necessary for a useful comparison.
- Hostname and TLS SNI matter when testing a specific origin address.
- A TCP-only replacement can hide the original application failure.
Reproduce the monitor request, not a convenient approximation
Write down the exact URL, method, accepted statuses, headers, authentication, timeout, and redirect policy. A browser may follow redirects and carry login cookies while the monitor sends an unauthenticated request. A command on the host may use a different resolver and route from the checking container.
Run the equivalent request from the same network namespace using an approved diagnostic image if the application container has no troubleshooting tools. Do not install an unreviewed package into a running production container merely to get a quick result. Record the destination address, certificate identity, response status, and request time.
Separate DNS from virtual-host behavior
Use the public hostname as the URL, even when comparing a known origin address. A request to a raw IP can select a default virtual host and present the wrong TLS identity. This curl example (opens in a new tab) pins the destination address for a direct connection; replace the documentation host and address with your own.
Run this example only from a location permitted to connect directly. The --noproxy '*' option prevents inherited proxy settings from changing the path. If an outbound proxy is mandatory, use an approved diagnostic location or inspect the proxy's upstream connection separately; --resolve alone does not control an HTTP CONNECT proxy's origin resolution.
umask 077
probe_dir="$(mktemp -d)"
curl --noproxy '*' --resolve app.example.com:443:192.0.2.10 \
--connect-timeout 5 --max-time 15 \
--dump-header "$probe_dir/headers.txt" \
--output "$probe_dir/body.txt" \
https://app.example.com/health
The private temporary directory can contain sensitive headers or response data; inspect it locally and remove it when the investigation is complete. Do not disable TLS verification to declare the monitor fixed. If the pinned request works but normal resolution fails, compare DNS answers and reachability for each address family.
Inspect each redirect and responding layer
Capture the initial response before following redirects. Check whether HTTP redirects to HTTPS, whether a canonical host changes, and whether an authentication gateway sends the client to a login page. Match the probe time and source address in Nginx access and error logs, then inspect upstream status and timing.
| Result | Likely next inspection |
|---|---|
| No matching Nginx request | DNS, routing, TLS handshake, or another edge |
| Proxy returns 502 or 504 | Upstream reachability and timeout |
| Redirect ends at a login page | Intended authentication contract |
| HTTP 200 with wrong body | Virtual host, rewrite, or frontend failure |
| IPv4 succeeds and IPv6 fails | Address-family path |
The Uptime Kuma reverse-proxy documentation (opens in a new tab) applies when Nginx fronts Kuma itself, including its connection requirements. Keep that separate from Nginx fronting the application being monitored; they are two different request paths and can fail independently.
Restore the application assertion
Once the path is understood, retain the expected status and a stable content or JSON assertion. For a private endpoint, use an explicitly scoped machine identity or a deliberately public minimal health endpoint. A 401 response may be correct for unauthenticated users while still requiring a different monitor design.
Test a real application failure behind the open proxy port. The HTTP monitor should fail while a TCP test can still succeed. Then verify a valid recovery and the notification received. Record the request contract with the monitor so a later authentication or rewrite change can be reviewed against a concrete expectation.
Did this help?
Your answer helps us improve this guide. We save only the page and your choice for 30 days.
No name, email, or incident details are requested.
Sources
Vendor facts change. Each source below shows the date this page last checked it.
- curl command-line reference — curl. Checked 12 September 2026.
- Uptime Kuma reverse proxy configuration — Uptime Kuma. Checked 12 September 2026.
Related
One practical idea, occasionally
The On-Call Brief: short field notes, templates, and operational lessons.
Follow the field guide
Email subscriptions are not open yet. Read new guides in your feed reader — no email address needed.
Subscribe with RSS