AI Workshop: learn to build apps with AI →
Nginx: What is a reverse proxy?

Join the AI Workshop and learn to build real-world apps with AI. A hands-on, practical program to level up your skills.


When we talk about servers, it’s common to hear the term “reverse proxy”.

In this lesson I’ll explain what a reverse proxy is and what it’s useful for.

Let’s first talk about what a proxy is. A proxy is a server that accepts connections from clients who have configured it in their network settings.

When a client makes a connection to a server, the requests always pass through that proxy server.

This practice has several uses. Companies and organizations can set up proxy servers to filter connections, provide more security, and log traffic. Without using the proxy, clients can’t reach the outside network. Proxy servers are also useful to provide privacy and avoid network restrictions imposed by country governments.

A reverse proxy, on the other hand, is set up by the server. It’s completely transparent to clients—they don’t know this middleman exists—but it does a very useful job on the server side, filtering requests and sending them to the appropriate service that handles them.

It’s common to use Nginx as a reverse proxy, and have services written, for example, in Node.js listening on internal ports, inaccessible from the outside.

Nginx in this case serves as the main request handler, and sends the appropriate requests, for example linking special subfolders or URLs to specific services.

We can have two different Node.js apps doing two completely different things, and the user does not need to know about that.

Besides this routing functionality, which is what we developers mostly use it for, reverse proxies are also great for filtering and protecting from attacks, acting as a firewall, to introduce caching, to configure SSL, to handle load balancing, A/B testing, and much more.

Lessons in this unit:

0: Introduction
1: ▶︎ What is a reverse proxy?
2: How to configure Nginx for HTTPS
3: A simple nginx reverse proxy for serving multiple Node.js apps from subfolders