# Application Server

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

**Field:** Infrastructure  
**Category:** Web Serving & Nginx  
**Also known as:** App Server

## Think of it like

It is like the kitchen in a cafe. The waiter takes your order, but the kitchen cooks it.

## Definition

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.

## Common mistake

Putting the app server straight on the internet. A web server in front handles TLS, slow visitors and files far better.

## Three principles

- **Runs code.** Builds each answer fresh.
- **Behind a web server.** Which passes requests to it.
- **Talks to data.** Reads and writes the database.

## Related terms

- [Web Server](https://learn.benibix.com/term/infrastructure/web-server)
- [Reverse Proxy](https://learn.benibix.com/term/infrastructure/reverse-proxy)
- [Back End](https://learn.benibix.com/term/development/back-end)
- [Web Application](https://learn.benibix.com/term/development/web-application)
- [Database](https://learn.benibix.com/term/development/database)
- [Node.js](https://learn.benibix.com/term/development/nodejs)

## Told apart from

- [Web Server vs Application Server](https://learn.benibix.com/compare/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.

![A browser on the left sends a request to a web server such as Nginx or Apache. The web server reads plain files straight from its document root folder, and passes every other request to an application server, which reads a database. Each request also adds one line to an access log file.](https://learn.benibix.com/diagrams/inf2-web-server.svg)

---

Source: https://learn.benibix.com/term/infrastructure/application-server
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-19
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
