Skip to content
BENIBIX Learn

Web Server vs Application Server

People think a web server and an app server are the same program, and they are not. A web server takes every request and sends plain files, like images, by itself. An app server runs your code to build each answer from the data. Most sites run both, with the web server in front. Small sites can use one program for both jobs, which blurs the line.

Infrastructure🌍 Web Serving & Nginx

Web Server

A program that answers web requests. It sends back pages and files.

A web server is a program that answers HTTP requests. A browser asks for a page, and the web server sends back the file or the answer. It listens on port 80 for HTTP and port 443 for HTTPS. It can hand out files from a folder, or pass the request on to an app. The word also means the computer that runs this program.

Example
Emma puts her site's files on a server running Nginx. When someone visits, Nginx reads index.html from the folder and sends it back.
Why it matters
Every website sits behind one. It is the first thing a visitor's request reaches.
Full entry
Infrastructure🌍 Web Serving & Nginx

Application Server

A program that runs your app's code to build each answer when it is asked.

An application server runs the code that builds answers as they are asked for. It reads from a database, does sums and makes a page or some JSON for each request. A web server most often sits in front of it. The web server sends files itself and passes everything else on to the app server.

Example
Lucy's shop runs a Python app on Gunicorn. Nginx sends the images itself. It passes each order page to Gunicorn, which builds it from the database.
Why it matters
Splitting the two lets each do what it does best. The web server handles crowds, and the app server handles the logic.
Full entry

In one line

Web Server
A program that answers web requests. It sends back pages and files.
Application Server
A program that runs your app's code to build each answer when it is asked.