Web Server Fundamentals
A web server is software that accepts HTTP requests from clients and returns files or generated content over the network. It maps URLs to resources, terminates TLS, and can reverse-proxy to application backends.
itWeb servers, proxies, and traffic management | OpenSkills.info
Intro
Web Server Fundamentals
A web server is the software that answers HTTP requests. A client — usually a browser, but also crawlers, API clients, and other servers — sends a request for a resource identified by a URL. The web server decides what to do with that request: serve a file from disk, generate content by handing the request to an application, redirect the client elsewhere, or return an error. The term is also used for the machine running that software, but the meaningful boundary is the software: the same hardware can run many web server instances, and the same web server can serve many sites.
The useful mental model is a URL-to-response engine with a rulebook. The rulebook is the server's configuration. Every request arrives carrying a method, a path, headers, and optionally a body. The server matches the request against its rules, produces an HTTP response — a status code, headers, and a body — and closes or reuses the connection. Everything else a web server does (TLS, virtual hosting, compression, caching, proxying) is a specialization of that loop.
Why web servers exist
The earliest web servers did one job: map a URL to a file on disk and send the bytes back. That model still works for static content — HTML, images, CSS, JavaScript — and a file-serving web server is still the right tool for static sites, single-page applications, and asset delivery.
Three pressures pushed web servers beyond plain file serving:
- Dynamic content — pages whose content depends on the request (a logged-in user's profile, search results, a shopping cart). The server hands the request to an application process that builds the response, often pulling data from a database. The web server sits in front of that application and relays the request and response.
- Scale and security — a single application process cannot hold thousands of concurrent connections, terminate TLS efficiently, and shield itself from the public internet at the same time. A web server in front absorbs the connection and TLS work, then forwards plain HTTP to the backend.
- Many sites on one host — HTTP/1.1 added the
Hostheader so one web server listening on one address and port can serve many sites, selecting among them by the requested host name. This is virtual hosting, and it is why one web server instance fronts a whole platform instead of one site.
These pressures produced the two shapes you meet everywhere today: the static web server (file server plus TLS) and the dynamic web server (static server plus an application server and a database behind it). A web server is not a single product; it is a role.
The request/response loop
Regardless of which server software you run, the processing loop is the same:
1. accept a TCP connection on a listening address and port
2. (optionally) perform a TLS handshake over that connection
3. read an HTTP request: method, target, headers, optional body
4. match the request against configured rules (virtual host, path, method)
5. produce a response: serve a file, proxy to a backend, redirect, or error
6. write an HTTP response: status code, headers, body
7. close the connection, or keep it open and reuse it for the next request
The transport is TCP (or, for HTTP/3, QUIC over UDP). HTTP itself does not require a connection-based transport; it requires only that messages arrive reliably and in order. TCP provides that, so HTTP/1.x and HTTP/2 run over TCP. HTTP/3 runs over QUIC, which builds reliability and stream multiplexing on top of UDP instead.
Continue the course
This section is part of the paid course.
See pricing to subscribe, or log in if you already have access.
Where this skill leads
Relevant careers
See how this topic contributes to broader role-level skill maps.
Sources
- https://developer.mozilla.org/en-US/docs/Learn/Common_questions/Web_mechanics/What_is_a_web_server
Supports
- Web server as hardware and software; the software boundary is the meaningful one
- Static web server (HTTP server plus files) versus dynamic web server (plus application server and database)
- The request loop: browser requests a file, HTTP server finds it, returns it or a 404
- Hosting rationale: availability, always-on connectivity, dedicated IP, third-party maintenance
- HTTP is a textual, stateless, application-layer protocol
- https://developer.mozilla.org/en-US/docs/Web/HTTP/Overview
Supports
- HTTP as a client-server, request/response protocol; the user-agent initiates
- Components of HTTP-based systems: client (user-agent), server, proxies
- HTTP is stateless but not sessionless (cookies add sessions)
- Connections: HTTP/1.0 one connection per request; HTTP/1.1 persistent connections and pipelining; HTTP/2 multiplexing; QUIC experiments over UDP
- HTTP flow: open TCP, send message, read response, close or reuse
- Request and response message structure (method, path, version, headers, body; status, headers, body)
- Caching, authentication, proxying/tunneling, sessions, and CORS as features controllable by HTTP
- https://www.rfc-editor.org/rfc/rfc9110.html
Supports
- Authoritative definitions of HTTP methods, status codes, and header semantics
- Content negotiation and caching semantics referenced by this course
- https://www.rfc-editor.org/rfc/rfc9112.html
Supports
- HTTP/1.1 wire format and the mandatory Host header enabling name-based virtual hosting
- Persistent connections (keep-alive) and message parsing the server performs
- https://www.rfc-editor.org/rfc/rfc9113.html
Supports
- HTTP/2 stream multiplexing over one TCP connection and binary frame layer
- HPACK header compression referenced in the HTTP versions comparison
- https://www.rfc-editor.org/rfc/rfc9114.html
Supports
- HTTP/3 over QUIC (UDP), combined transport and TLS handshake, per-stream loss recovery
- Why a server adopting HTTP/3 needs a QUIC-capable listener
- https://www.rfc-editor.org/rfc/rfc6066.html
Supports
- Server Name Indication (SNI) carrying the host name in the TLS ClientHello
- How name-based virtual hosting works under HTTPS
- https://developer.mozilla.org/en-US/docs/Web/HTTP/Caching
Supports
- Cache-Control, ETag, Last-Modified, Vary, and conditional (304) request behavior
- Browser, shared proxy, and origin cache layers
- https://httpd.apache.org/docs/2.4/
Supports
- Apache's directive and context configuration model referenced as one concrete server
- MPMs (prefork, worker, event) as the concrete instances of the three concurrency models
- https://nginx.org/en/docs/
Supports
- NGINX master/worker architecture and event-driven concurrency model
- Configuration contexts (main, events, http, server, location) referenced as the rulebook example
- Reload behavior: validate new config, start new workers, old workers finish in-flight requests
- https://awesome-selfhosted.net/tags/web-servers.html
Supports
- Curated discovery source for which web server and reverse-proxy projects belong on the Awesome Links page (Apache, Caddy, lighttpd, HAProxy, Nginx Proxy Manager, Traefik)
