#virtual-host
Posts
-
Digging into nginx's Source 8: Reading an HTTP Request — From a Connection to ngx_http_request_t
We follow, through the source, how one accepted socket becomes an ngx_http_request_t inside nginx — why the request struct is not created until data arrives, the switch-based state machines that parse the request line and headers, where client_header_buffer_size and large_client_header_buffers are used, the order in which the Host header picks a server block, and keep-alive and pipelining, all checked with debug logs, gdb and nc.
-
Digging into Apache httpd's Source 9: Connections and Reading a Request — From a Socket to a request_rec
Follows one socket handed over by the MPM as it becomes a conn_rec, and then a request_rec once the request line and headers are read — all in the httpd source. Why the core always stands last in the hooks, where the keep-alive loop lives depending on the MPM, how trunk moved request-line reading into a filter, and the two steps that pick a virtual host from the Host header, each checked with an example.
-
Digging into Apache httpd's Source 15: mod_ssl — Where TLS Plugs In
The httpd core knows nothing about TLS, yet one SSLEngine on line gives you HTTPS. We follow, in the source and with examples, how mod_ssl hooks into startup and every connection, slips OpenSSL into the filter chain with connection filters and home-made BIOs, swaps the virtual host and certificate based on SNI, and hands SSL_* variables to other modules.
-
Digging into Tomcat's Source 7: CoyoteAdapter and the Mapper — Which Servlet Gets the Request
We follow CoyoteAdapter, the bridge that carries a fully read HTTP request from Coyote into Catalina; postParseRequest(), which decodes and normalizes the URI on the way; and the order of rules the Mapper uses to pick a Host, a Context and a Wrapper. Six servlets show the mapping priorities, curl shows what happens to %2F, .. and ;jsessionid, and a request object held too long shows why RequestFacade exists.