All guides
Home Glossary Reverse proxy
Term

Reverse proxy

An intermediary server that receives incoming client requests and forwards them to one or more internal backend servers.

A reverse proxy is an intermediary server that receives incoming client requests and forwards them to one or more internal backend servers. Unlike a standard forward proxy that acts on behalf of clients to mask their identity, a reverse proxy sits in front of web servers to secure, manage, and optimize backend infrastructure. It acts as the single public entry point for external traffic, hiding internal IP addresses and network topology from the open internet.

How it works

When a user sends a request to a domain, DNS resolves the address to the reverse proxy rather than the application server itself. The proxy terminates the incoming connection, inspects the HTTP headers or URL path, and opens a separate internal connection to the appropriate backend service. Once the backend processes the request, the proxy relays the response back to the client.

  • Load Balancing: Distributing incoming requests across multiple backend instances using algorithms like round-robin or least-connections to prevent single-server overload.
  • SSL/TLS Termination: Decrypting HTTPS traffic at the edge so backend application servers do not spend CPU cycles on cryptographic handshakes.
  • Caching and Compression: Storing static assets in memory and applying Gzip or Brotli compression to reduce bandwidth usage and lower response times.
  • Security Filtering: Enforcing rate limits, blocking malicious payloads via a Web Application Firewall (WAF), and absorbing basic DDoS traffic before it reaches core services.

Widely used implementations include Nginx, HAProxy, Traefik, and Caddy. While outbound data collection relies on client-side routing techniques covered in our Proxy Rotation on VPS: Architecture and Performance Guide, a reverse proxy focuses strictly on inbound traffic orchestration.

Example

In a typical containerized deployment, Nginx routes public HTTPS traffic to an internal Node.js or Python application listening on a local port. The configuration below passes client metadata forward while keeping port 8080 firewalled from external access:

server {
    listen 80;
    server_name api.example.com;

    location / {
        proxy_pass http://127.0.0.1:8080;
        proxy_http_version 1.1;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
    }
}

By changing the proxy_pass target and reloading the configuration, administrators can execute zero-downtime blue-green deployments.

What matters when choosing a server or hosting

Because every byte of inbound and outbound traffic passes through the reverse proxy, network throughput and low latency between the proxy node and backend servers are critical. Hosting both layers within the same private virtual network (VPC) avoids public internet egress fees and minimizes internal round-trip time.

CPU performance matters primarily for TLS handshakes and on-the-fly response compression, while RAM size dictates how much static content can be cached in memory. If your infrastructure handles high-concurrency workloads or automated crawlers, examine the resource trade-offs detailed in our Proxy Server for Parser: Performance and Cost Data and VPS for Web Scraping: Hard-Won Performance and Proxy Data guides.

Common mistakes

  • Omitting forwarding headers: Failing to set X-Forwarded-For and X-Forwarded-Proto causes backend applications to log the proxy's local IP for every visitor and generate broken HTTP redirect loops.
  • Leaving backend ports publicly accessible: Deploying a reverse proxy provides no security benefit if firewall rules still allow direct external connections to backend ports like 3000 or 8080.
  • Misconfigured timeouts and buffer sizes: Default proxy timeouts often drop legitimate long-running API requests or file uploads, resulting in premature 502 Bad Gateway or 504 Gateway Timeout errors.

FAQ

What is the difference between a reverse proxy and a load balancer?

A load balancer is specifically designed to distribute network traffic evenly across a pool of identical servers. A reverse proxy can perform load balancing, but it also handles single-server tasks such as SSL termination, caching, URL rewriting, and security filtering.

Does a reverse proxy slow down requests?

Adding an extra network hop introduces a negligible fraction of a millisecond in latency on a local network. In practice, a reverse proxy usually speeds up overall delivery through HTTP/2 multiplexing, connection pooling, and static asset caching.

Can a reverse proxy and backend run on the same VPS?

Yes. Running Nginx or Caddy on the same virtual machine as your application is standard practice for small to medium deployments, simplifying SSL certificate automation and isolating application ports from the public interface.

All glossary terms

Glossary

Related terms

Full glossary

New guides every week.

A digest of the best pieces on servers, VPN and self-hosted software. No ads, no spam.

1 email a weekOne-click unsubscribeRU · EN
Only slipjar.app articles, nothing else.