Blog

4 Reverse Proxy Examples: How Websites Route and Protect Traffic

A reverse proxy is the control point that sits in front of websites, sends requests to the right backend, and blocks bad traffic before it reaches the app. That is why large sites place it at the edge, not as an afterthought. Scale and abuse both hit the front door first. In 2023, Cloudflare reported mitigating an HTTP/2 DDoS attack that peaked above 201 million requests per second [source: Cloudflare].

TLDR: A reverse proxy receives visitor requests first, then forwards clean requests to web servers, app servers, or APIs. For example, a store doing 50,000 visits per hour can use NGINX to split traffic across four app servers, so one weak server does not crash checkout. It can also add TLS termination, caching, bot filtering, and rate limits. The main win is simple: users get faster pages, while attackers and noisy clients hit the proxy instead of the core system.

1. NGINX Reverse Proxy for Load Balancing

NGINX is one of the most common reverse proxy choices. It sits between users and backend servers. When a request comes in, NGINX decides where to send it. That may be server A, server B, or server C.

This is useful when one machine can no longer carry the full load. A simple setup might look like this:

  • Visitor opens example.com.
  • NGINX receives the request.
  • NGINX sends it to one of three app servers.
  • If one server fails, NGINX can stop sending traffic there.

This protects uptime. It also keeps response times stable during spikes. A news site may use this during election night. A ticket site may use it when sales open at 10:00 a.m. Sharp traffic bursts are normal. Crashes should not be.

NGINX can also handle SSL or TLS termination. That means encryption is handled at the proxy, while backend servers receive regular internal traffic. This cuts repeated setup work across every app server. The official NGINX docs describe reverse proxy and load balancing as core use cases [source: NGINX].

2. Cloudflare Reverse Proxy for DDoS and Bot Protection

Cloudflare is often used as an edge reverse proxy. Your domain points to Cloudflare first. Then Cloudflare sends approved traffic to your origin server.

This setup hides the real server IP. That matters. If attackers do not know the origin IP, they have a harder time hitting it directly. Cloudflare can also block traffic by country, IP reputation, request rate, or rule patterns.

Common protections include:

  • DDoS filtering for traffic floods.
  • Web application firewall rules for known attack patterns.
  • Bot checks for scraping and fake login attempts.
  • Caching for images, scripts, and static pages.

Honestly, it feels like a waste to run a public site without some edge filter. Even a small login form gets hammered. A proxy will not make bad code safe, but it can reduce the noise before your app has to deal with it.

3. Kubernetes Ingress as a Reverse Proxy

In Kubernetes, a reverse proxy is often called an Ingress controller. It routes outside traffic into services inside the cluster. NGINX Ingress, Traefik, and HAProxy are common choices.

This is helpful because Kubernetes apps are split into many services. One site may have a frontend service, checkout service, account service, and search service. Users should not care about those internal parts. They just visit one domain.

An Ingress controller can route traffic like this:

  • / goes to the frontend service.
  • /api/orders goes to the order service.
  • /api/search goes to the search service.
  • /admin goes to an internal admin service with extra access rules.

This keeps public routing clean. It also gives teams one place to manage certificates, redirects, headers, and request limits. The catch is that broken Ingress rules can be painful. Expect to waste time on one missing annotation or a header that adds two extra seconds to login requests.

4. API Gateway as a Reverse Proxy

An API gateway is a reverse proxy built for APIs. It receives API calls, checks them, and sends them to the right service. Kong, AWS API Gateway, Apigee, and Envoy are common examples.

This model works well for mobile apps, SaaS platforms, and partner APIs. The gateway can enforce rules before requests hit business logic.

  • Authentication: Check API keys, JWTs, or OAuth tokens.
  • Rate limits: Block clients after too many calls.
  • Request logging: Track who called what and when.
  • Version routing: Send /v1 and /v2 traffic to different services.
  • Canary releases: Send 5% of traffic to a new API version.

This is where reverse proxies move from “traffic router” to policy gate. For example, a payments API may allow 100 requests per minute for free accounts and 5,000 per minute for enterprise customers. The app should not have to check that on every endpoint. The gateway can do it first.

What a Reverse Proxy Protects

A reverse proxy helps protect three things: availability, performance, and control.

  • Availability: It can route around failed servers.
  • Performance: It can cache files and reduce backend work.
  • Control: It can apply rules before traffic reaches the app.

Still, it is not magic. Bad access control is still bad access control. A reverse proxy cannot fix unsafe database queries or weak passwords by itself. It should sit beside secure code, logging, patching, and careful server setup.

The best pattern is simple. Put the reverse proxy close to the user. Let it filter, route, cache, and encrypt. Keep the origin servers private when possible. Then watch logs closely, because traffic patterns often reveal problems before users complain.

To top