Skip to content

What is a reverse proxy?

Find out what is a reverse proxy and what is it useful for!

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

In this post I want to explain what is a reverse proxy, and what it’s useful for.

Let’s first talk about what’s a proxy. A proxy is a server that accepts connections from clients, which actively configured the proxy server on their machines, 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 countries 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 servers, 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, unaccessible 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 2 different Node.js apps doing 2 completely different things, and the user does not need to know about that.

Beside this routing functionality, which is what us developers will mostly use it for, reverse proxies are also great to filter and protect from attacks serving as a firewall, to introduce caching, to configure SSL, to handle load balancing, A/B testing, and much more.


download all my books for free

  • javascript handbook
  • typescript handbook
  • css handbook
  • node.js handbook
  • astro handbook
  • html handbook
  • next.js pages router handbook
  • alpine.js handbook
  • htmx handbook
  • react handbook
  • sql handbook
  • git cheat sheet
  • laravel handbook
  • express handbook
  • swift handbook
  • go handbook
  • php handbook
  • python handbook
  • cli handbook
  • c handbook

subscribe to my newsletter to get them

Terms: by subscribing to the newsletter you agree the following terms and conditions and privacy policy. The aim of the newsletter is to keep you up to date about new tutorials, new book releases or courses organized by Flavio. If you wish to unsubscribe from the newsletter, you can click the unsubscribe link that's present at the bottom of each email, anytime. I will not communicate/spread/publish or otherwise give away your address. Your email address is the only personal information collected, and it's only collected for the primary purpose of keeping you informed through the newsletter. It's stored in a secure server based in the EU. You can contact Flavio by emailing [email protected]. These terms and conditions are governed by the laws in force in Italy and you unconditionally submit to the jurisdiction of the courts of Italy.

Related posts about network: