Skip to content

HTTP for Operators

First PublishedByAtif Alam

This page supports debugging and designing HTTP(S) paths through load balancers, API gateways, reverse proxies, and Kubernetes Ingress. It pairs with TCP/IP Primer and TLS and Certificates.

An HTTP/1.1 message has:

  • Start lineMETHOD /path HTTP/1.1 or status line HTTP/1.1 200 OK.
  • HeadersHost, User-Agent, Content-Type, Authorization, etc.
  • Body — Optional; common for POST/PUT.

HTTP/2 multiplexes streams over one TCP connection; operators still see status codes and pseudo-headers (:method, :path, :authority) in tools.

MethodTypical useIdempotent?
GETRead resourceYes
HEADLike GET, no bodyYes
POSTCreate or non-idempotent actionNo
PUTReplace resourceYes
PATCHPartial updateSometimes
DELETERemove resourceYes

Idempotent methods are safer to retry after ambiguous network failure — the spec intent matters for APIs and caches.

RangeMeaningExamples
2xxSuccess200 OK, 201 Created, 204 No Content
3xxRedirection301, 302, 304 Not Modified
4xxClient error400, 401, 403, 404, 429
5xxServer / gateway error502 Bad Gateway, 503 Service Unavailable, 504 Gateway Timeout

502/504 at a load balancer often mean unhealthy backends, timeout to origin, or TLS handshake failure to upstream — check target group health, security groups, and upstream certs.

HeaderWhy operators care
HostVirtual hosting and routing (ALB listener rules, Ingress host).
X-Forwarded-ForOriginal client IP through proxies — trust only from known hops.
X-Forwarded-ProtoWhether the client used https; apps use it to build redirects.
AuthorizationBearer tokens, Basic — often logged by mistake; avoid logging full values.
Content-Length / Transfer-EncodingMismatches cause 400 or hung connections.

Keep-Alive reuses TCP connections for multiple requests. Idle timeouts on ALB, nginx, or API Gateway can close connections while clients still expect them open — symptoms: intermittent connection reset or 502 under load.

Align client, proxy, and server timeouts; health check intervals should be lower than idle cutoff where possible.

Termination at the load balancer (or Ingress): clients use HTTPS to the edge; traffic to backends may be HTTP (in private network) or HTTPS (re-encrypt). Operators must know:

  • Which component holds the certificate (e.g. ACM on ALB — TLS and Certificates).
  • Whether SNI is required for shared IPs.
  • Whether mTLS is enforced between client and edge, or edge and origin.

End-to-end TLS to the pod is a different model (service mesh, sidecars) — certificate rotation and trust move inward.

SymptomChecks
403 from WAFAWS WAF rules, geo blocks, rate limits.
404 only through LBWrong path rule, missing Host match, or Ingress backend typo.
Redirect loopHTTP/HTTPS mismatch and X-Forwarded-Proto handling.
Large upload failsBody size limits on proxy or API Gateway; timeout.
Works with curl, not browserCORS is application-layer (not TCP); check API and preflight.
  • curlcurl -v, -H, --resolve to test SNI and Host.
  • openssl s_clientopenssl s_client -connect host:443 -servername host for TLS handshakes.
  • Browser devtools — Network tab for status, timing, redirects.

HTTP at the edge is routing + TLS + timeouts + headers. When logs show a status code, trace which hop generated it (WAF, LB, app) before changing application code.