Skip to content
hostcomplex

Reverse Proxy

Maarten Soetens 3 min read

How a Reverse Proxy Sits in Front of Servers

What is a reverse proxy? It is a server that receives requests from visitors on behalf of one or more backend servers, forwards them where needed, and returns the responses. From the visitor's side, the reverse proxy is the website. The application servers behind it stay out of direct view.

The name describes its position. A forward proxy stands in front of clients, such as computers on a corporate network, and sends their requests out. A reverse proxy stands in front of servers and handles incoming requests. The two are compared in reverse proxy vs forward proxy. Common reverse proxy software includes NGINX, HAProxy and Varnish, and content delivery networks use the same principle.

What a Reverse Proxy Does for a Website

Several jobs often run on the same proxy. The first is caching: the proxy stores responses and answers repeat requests without contacting the application. Tools for this are covered in Varnish and NGINX FastCGI cache. The second is load balancing, which spreads requests across several application servers so that no single machine is overloaded and a failed one can be skipped.

A third job is TLS termination. TLS is the encryption behind HTTPS, and the proxy handles that encrypted connection with visitors, then passes the traffic on to the application. This centralizes certificate management in one place. A fourth job is routing, where requests for different domain names or paths go to different backends. Finally, a reverse proxy can limit request rates and add security headers before traffic reaches the application.

Example: One Address for Several Services

Imagine a company that runs its shop, its blog and a customer portal on three separate application servers. Visitors know only one address. The reverse proxy receives every request and forwards it based on the requested domain or path. If the blog server needs maintenance, the proxy can hold blog traffic or send it elsewhere for a few minutes. Visitors keep the same address, and the application servers never need to be reachable directly from the internet.

Frequently asked questions

Does a Reverse Proxy Make a Website Faster?

It can. A proxy that caches responses serves many requests without doing the application's work, and TLS termination can reduce connection overhead on the application servers. However, the proxy adds one more step, so it only improves speed when it does useful work such as caching. A poorly configured proxy can slow traffic down.

Is a CDN a Reverse Proxy?

A CDN works like a reverse proxy because it receives visitor requests and serves cached content or fetches it from the origin. Many CDNs are built on reverse proxy technology. The difference is scale and placement: a CDN spreads edge servers across regions, while a reverse proxy is often a single component in one data center. A site can also run its own reverse proxy behind a CDN.

  • Two-Factor Authentication

    Two factor authentication hosting adds a second check to control panel, domain and CMS logins. Learn which methods are strongest and why 2FA helps.

  • What Is an A Record?

    What is an A record? Learn how this DNS record maps a hostname to an IPv4 address, why domains use several A records and the root and www pattern.

  • Billing and Automation Platforms

    What is WHMCS? Learn how this commercial billing and automation platform helps hosts sell plans, collect payments and create accounts automatically.