Web Server
A web server is the software, hardware, or combination of systems that receives web requests and returns website resources.
It is the system that responds when a browser requests a webpage, image, stylesheet, API response, or other web resource.
MDN describes a web server as both the server hardware and the HTTP-server software responsible for receiving requests and delivering website files or generated responses. MDN's guide to web servers
What It Does
A browser might request:
GET /about/The web server determines how that request should be handled.
It may:
- Return an HTML file
- Run application code
- Query a database
- Return an API response
- Issue a Redirect
- Return an HTTP Status Code such as 404
Static vs. Dynamic Serving
A static website may serve existing files directly.
For example:
/about/index.htmlA dynamic application may generate the response using:
The browser receives the resulting response either way.
Web Server vs. Hosting
Web Hosting is the broader service or infrastructure.
The web server is one component responsible for answering web requests.
A hosting platform may manage the server entirely on the customer's behalf.
Why It Matters
Server behaviour affects:
- HTTP Status Codes
- Redirects
- HTTPS
- Caching
- Website Performance
- Application routing
- Security headers
It therefore influences much more than simply storing files.
Common Problems
Common problems include:
- Server returning wrong status codes
- Redirect loops
- Outdated server software
- Incorrect HTTPS configuration
- Application errors
- Slow server response
- Server configuration changed without documentation
How to Improve
Let managed infrastructure handle server administration where there is no business need to manage it directly.
Where server configuration is custom, document the important behaviour and keep configuration under controlled change management.