19 / 25 · Service boundaries

Reverse proxy

A reverse proxy receives requests on behalf of backend servers and forwards them. It can terminate TLS, route paths or hosts and manage forwarding behavior. It is different from a forward proxy used on behalf of clients.

What you will practise

  • Trace proxy forwarding
  • align limits/timeouts
  • define trusted headers

Before you start: HTTP request, backend and forwarded header.

About 4 minutes · offline-generated English female narration · captions included. Diagrams are conceptual; timings are illustrative.

Download MP4Captions

Listen without the videoDownload audio

The same pre-recorded voice as the video. Starting audio pauses the video, and starting the video pauses audio.

Chapters and full transcript

Let us understand reverse proxy. A reception desk receives mail for several offices and forwards each envelope internally. Outside visitors know the public address rather than every room. The desk must preserve important information and must not believe a forged note saying that an envelope came from the principal. A reverse proxy receives requests on behalf of backend servers and forwards them. It can terminate TLS, route paths or hosts and manage forwarding behavior. It is different from a forward proxy used on behalf of clients.

Follow the normal path. The browser talks to one public address. The reverse proxy represents backend servers rather than acting as the browser own outbound proxy. Host and path rules select a backend. Request size, deadlines, TLS termination and supported protocols must fit the actual workload. SeatSpot can expose one HTTPS hostname while forwarding application and static paths to different backends. This central entry layer needs deliberate timeout, buffering and trusted-header behavior.

Now change one condition. API traffic reaches the API backend and asset traffic can reach another backend. A reverse proxy can also perform load-balancing duties. A common misunderstanding is this: A reverse proxy and load balancer cannot be the same component. These are roles that can overlap in one product. Think about this. A client sends X-Forwarded-For claiming to be an administrator. Should your backend trust it? Pause the video and make your prediction. Only through a verified proxy chain with controlled header rewriting. A client-supplied header is not trusted identity.

Let us reason with a concrete example. A browser uploads a large image through a proxy to the application. The application body limit does not help if the proxy rejects it first; conversely, a permissive proxy does not bypass the application validation. The smallest relevant limit wins. Align intended limits and return understandable errors. For streaming, inspect buffering and timeouts along the full path. These figures are teaching examples, not production guarantees.

Turn the idea into a design decision. Forward useful request context, but do not accept forged identity or client-IP headers from arbitrary clients as trusted facts. Buffering and idle/read timeouts can change what a browser sees. Test streams and long-lived connections end to end instead of assuming default behavior fits. When you try the practice task, look for this result. The narrowest relevant limit can reject the request; streaming needs deliberate buffering and timeout choices.

Check your understanding. The public entry point needs its own capacity, redundancy and monitoring. Backend replicas do not help if the only proxy is unavailable. Here is a challenge. An API stream produces tokens but the browser sees them all at once. What might be happening? Pause before the answer. A proxy/CDN may buffer the response. Verify streaming support, flush behavior, timeout and cache/compression policies across the actual path before changing application logic blindly. For an interview, discuss TLS termination, headers, limits and connection draining. Say what you would measure, not only which tool you would buy.

Start with an everyday picture

A reception desk receives mail for several offices and forwards each envelope internally. Outside visitors know the public address rather than every room. The desk must preserve important information and must not believe a forged note saying that an envelope came from the principal.

Why SeatSpot needs this

SeatSpot can expose one HTTPS hostname while forwarding application and static paths to different backends. This central entry layer needs deliberate timeout, buffering and trusted-header behavior.

Trace one step at a time

Move through the diagram at your pace. Teal paths are active; unavailable components are labelled.

BrowserReverse proxyAPI backendAsset backendRequest policy

Step 1 of 6 · Server-side entry role

Receive the public request

The browser talks to one public address. The reverse proxy represents backend servers rather than acting as the browser own outbound proxy.

Read all six mechanism steps
  1. Receive the public request

    The browser talks to one public address. The reverse proxy represents backend servers rather than acting as the browser own outbound proxy.

  2. Apply forwarding rules

    Host and path rules select a backend. Request size, deadlines, TLS termination and supported protocols must fit the actual workload.

  3. Forward the request

    API traffic reaches the API backend and asset traffic can reach another backend. A reverse proxy can also perform load-balancing duties.

  4. Preserve trusted context

    Forward useful request context, but do not accept forged identity or client-IP headers from arbitrary clients as trusted facts.

  5. Handle streaming deliberately

    Buffering and idle/read timeouts can change what a browser sees. Test streams and long-lived connections end to end instead of assuming default behavior fits.

  6. Protect the proxy tier

    The public entry point needs its own capacity, redundancy and monitoring. Backend replicas do not help if the only proxy is unavailable.

Pause and make a prediction

A client sends X-Forwarded-For claiming to be an administrator. Should your backend trust it?

Answer aloud or write your reasoning in the lesson notes before revealing the explanation.

Correct a common misunderstanding

Claim to question: A reverse proxy and load balancer cannot be the same component.

Better explanation: These are roles that can overlap in one product.

Inspect a proxy path

A paper or whiteboard task. No cloud account or paid infrastructure is required.

  1. Draw browser → proxy → application.
  2. Put body limits and timeouts at both boundaries.
  3. Explain what changes for a long-lived stream or WebSocket.

Check what you can explain

This is your self-check, not an automated grade. Try again without the diagram tomorrow.

0 of 3 goals checked. Choose one remaining idea to practise next.

These checkboxes reset when you leave. Use your saved lesson notes and completion marker to record lasting progress.

Teach it back

Without looking, explain what this component changes, what it does not solve and what happens if it fails. Use the animation to check your explanation, then switch to Engineering.

Try it before viewing the solution

An API stream produces tokens but the browser sees them all at once. What might be happening?

Check one key idea

Forwarded identity headers should be:

Your explanation and interview notes

Saved only in this browser when storage is available. Export a backup from the course page before clearing browser data or moving devices.

Loading your local notes…

Official references and next reading

The explanation, fictional examples and animations are original teaching material. Vendor behavior depends on the specific product/version; use its documentation before deploying.