Debug Nginx Proxies Layer by Layer

📖 1 minute read

When your Nginx reverse proxy isn’t working, test in this exact order:

Step 1 — Test from the server itself:

curl http://localhost/api

Step 2 — Test via server IP:

curl -k https://SERVER_IP/api

Step 3 — Test via domain:

curl https://yourdomain.com/api

Why this order matters:

  • Step 1 fails → Nginx config is broken
  • Step 2 fails → SSL certificate issue
  • Step 3 fails → DNS, CDN, or firewall issue

I recently debugged a proxy where Step 1 returned perfect responses but Step 3 returned just “OK” (2 bytes). That immediately told me the problem wasn’t Nginx — it was the CDN caching a broken response from an earlier deployment.

Each layer adds complexity. Test each layer separately. When something breaks, you instantly know which layer to investigate instead of guessing.

Daryle De Silva

VP of Technology

11+ years building and scaling web applications. Writing about what I learn in the trenches.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *