#reverse-proxy
Posts
-
Digging into nginx's Source 11: Upstream and Proxy — One Request Through the Reverse Proxy
We follow, in the source, how one proxy_pass line installs a content handler on a location, how the proxy module fills the callbacks of ngx_http_upstream_t, and how upstream then takes care of the non-blocking connect, sending the request, reading the response header and streaming the body. We check the request the backend actually receives (HTTP/1.1 by default in this version, and no Connection header), where 502 and 504 are decided, proxy_next_upstream, and proxy_buffering on/off with its temporary file — using debug logs, gdb and a tiny backend.
-
Digging into Apache httpd's Source 14: mod_proxy — Reverse Proxy and Load Balancer
We follow one ProxyPass line through the source until the request reaches another server. We see where the URL turns into a "proxy:..." r->filename, how proxy_handler() hands the work to the scheme handler hook, the worker and connection pool that each backend gets, how mod_proxy_http streams the response back through brigades, and how the byrequests balancer alternates between two backends — checked with two backends running in a container.
-
Digging into Tomcat's Source 8: Pipelines and Valves — The Processing Chain on Every Container
What does one <Valve> line in server.xml become in the source? We look at the pipeline each of Engine, Host, Context and Wrapper owns, the four basic valves at the ends that pick the next container, how a valve stops a request by not calling the next one, ErrorReportValve that draws the error page, the access log that is only written after the response has gone out, and the RemoteIpValve trap — checking it all against the source with our own valves hung on three containers.