Skip to content
עברית

Guide

Reverse Proxies

A reverse proxy accepts requests for a service and forwards them to selected origins. It can terminate TLS, balance load, cache responses and enforce access policies. The client may never connect directly to the application server, which changes how source addresses, schemes and request headers must be interpreted.

Meaning and purpose

A reverse proxy accepts requests for a service and forwards them to selected origins. It can terminate TLS, balance load, cache responses and enforce access policies. The client may never connect directly to the application server, which changes how source addresses, schemes and request headers must be interpreted.

How it works in context

Forwarded, X-Forwarded-For and X-Forwarded-Proto carry intermediary information by convention or standard. An origin must trust these fields only when the immediate sender is an approved proxy. A load balancer chooses an upstream; a reverse proxy can perform that function but the concepts are not identical. WebSocket upgrades require compatible forwarding behavior.

Communication model

Client → DNS → Network → Service → Response

The components are roles, not a guarantee that each request follows one fixed path. Caches and proxies can answer at different stages.

Technical terms in this section

How reverse proxies work

Reverse proxies accept client connections and create separate upstream exchanges with origins.

Nginx reverse proxy

Nginx reverse proxying uses upstream and proxy configuration to forward requests to origins.

Apache reverse proxy

Apache reverse proxying uses mod_proxy handlers and configured upstream mappings.

HAProxy

HAProxy balances transport or application traffic with configurable health checks and routing policy.

Traefik

Traefik reverse-proxies requests using configured routers, services and optional dynamic discovery.

Caddy

Caddy is a web server and reverse proxy with automatic HTTPS capabilities in supported configurations.

Reverse proxy vs. load balancer

Reverse proxying intermediates a service; load balancing distributes work among backend instances.

SSL termination

SSL/TLS termination decrypts one hop and requires separate assessment of the origin connection.

Request forwarding

Request forwarding sends an upstream exchange while preserving required HTTP semantics and metadata.

Header forwarding

Header forwarding must distinguish trusted proxy-generated metadata from untrusted client input.

X-Forwarded-For

X-Forwarded-For carries proxy-chain addresses that require an explicit trusted-proxy interpretation.

X-Forwarded-Proto

X-Forwarded-Proto reports the original scheme when supplied by a trusted proxy.

Forwarded

Forwarded standardizes selected proxy metadata including client, intermediary and scheme information.

Real client IP

Client-IP reconstruction requires trusted intermediary boundaries rather than blindly trusting forwarded headers.

Trusted proxies

Trusted proxies are explicitly approved intermediaries whose forwarding metadata may be accepted.

Host headers

Host fields identify the requested authority and should be validated against accepted site names.

Reverse proxy caching

Reverse-proxy caching reuses upstream responses with keys and policies that preserve user separation.

Reverse proxy security

Reverse-proxy security protects origin trust, accepted hosts and forwarding metadata boundaries.

WebSocket proxying

WebSocket proxying requires compatible connection establishment, long-lived forwarding and timeout handling.

Operational checks and security

Check the proxy-to-origin path separately from the public connection. Constrain accepted Host values and avoid blindly trusting user-supplied client-IP headers. Cache authenticated responses only under an explicit policy that prevents one user receiving another user’s content.

Read-only example

These commands inspect the surrounding system or protocol. They do not automatically change its configuration or establish every property of this term. Replace example targets only with destinations you are authorized to inspect.

nginx -t
# Inspect response fields without changing the origin
curl -I https://example.com

Sources and further reading

These explanations are educational. Implementations, policies and standards evolve; check the current specification and software version before changing a system.

Zaltzman.net · Your choice

Privacy preferences

Choose whether to link returning visits and remember display settings. Public content remains available without optional cookies.

Essential cookies

Always on

Secure forms, login sessions and your privacy choice.

What is included?

Session and CSRF protection, your privacy choice for up to 180 days, and Cloudflare security services. These do not authorise optional visitor analytics.

Analytics & returning visits

Store page history, visit times, IP and approximate location under one browser identifier, including return visits after an IP change.

How is this information used?

Authorised administrators use the history to understand usage and improve the site. No targeted ads, keystroke recording or fingerprinting. Turning this off deletes the history linked to your current identifier from the active database.

Remember display preferences

Save text size, contrast and other accessibility choices locally for your next visit.

Download my browser history

Turning analytics off deletes the current history and stops new collection.

Website operator: The Zaltzman Family
[email protected]

Zaltzman.net · Display settings

Accessibility tools

Adjust reading and navigation to suit you. Analytics consent is not required.

Text size
100%