ScreenshotNeo

BlogGuides

Forward Proxies vs. Reverse Proxies: How to Choose and Configure Each

A forward proxy represents clients accessing external resources; a reverse proxy represents backend services receiving client requests. Learn how each works, when to use it, and how to configure NGINX.

By the ScreenshotNeo team29 September 202610 min read

Forward Proxies vs. Reverse Proxies: How to Choose and Configure Each

A forward proxy sits between clients and external destinations and represents the client or client network. A reverse proxy sits in front of one or more backend servers and represents the service to incoming clients. To tell them apart, ask: whose side does the intermediary serve? The forward proxy mediates outbound access; the reverse proxy receives requests for a service and routes them inward.

The distinction is about role and traffic direction, not a specific product or physical appliance. Either arrangement can relay traffic, but neither label alone guarantees anonymity, security, caching, load balancing, or better performance. Those properties depend on the proxy’s configuration and the surrounding system. [Microsoft Learn: What is a proxy?]

1. The two traffic paths

In a forward-proxy setup, a client is configured to send requests through a proxy before they reach an external destination. In a reverse-proxy setup, the client requests the service, and the proxy forwards that request to an appropriate backend.

The forward proxy represents clients heading outward; the reverse proxy represents backend services receiving requests.
The forward proxy represents clients heading outward; the reverse proxy represents backend services receiving requests.
FORWARD PROXY
Client or client network  →  Forward proxy  →  External destination

REVERSE PROXY
Client  →  Reverse proxy for the service  →  One or more backend servers

The arrow direction is useful, but the represented party is the better mental model. A forward proxy represents clients. A reverse proxy represents the servers behind it. NGINX describes its basic proxy server as receiving requests, passing them to proxied servers, retrieving responses, and sending them to clients. [NGINX Beginner’s Guide]

2. Forward proxy: outbound access for clients

A forward proxy mediates requests from a client or a group of clients to external services. The client, operating system, application, or network administrator typically configures the proxy address. The proxy can then apply outbound access rules, record activity, or provide a controlled route to external resources. [MDN: Proxy servers and tunneling]

Common reasons to use one

  • Outbound policy: allow or deny access to destinations according to organizational rules.
  • Centralized logging: observe or record client requests at a managed point in the network.
  • Controlled network access: provide clients with a route to external resources through an intermediary.
  • Address masking in some configurations: the destination may see the proxy’s address instead of the client’s direct address.

That last point does not make a user anonymous. The proxy operator may still see traffic metadata and, depending on the protocol and TLS handling, may have visibility into contents. A proxy can also forward client details in headers. Review what the destination receives and what the proxy logs before relying on address masking. [MDN’s proxy and tunneling guide]

Explicit and transparent arrangements

With an explicit proxy, the client or its administrator knows the proxy address and configures traffic to use it. With a transparent proxy, network infrastructure intercepts or redirects traffic without the same client-side proxy configuration. These describe how traffic is directed to a forward proxy; they do not change the core role of serving client-side outbound requests. The exact behavior depends on the network and proxy implementation.

Do not treat a VPN as simply a forward proxy. VPNs can work at different network layers and have distinct routing and security behavior. Choose based on the traffic you need to route and the controls you need, not on a loose analogy.

3. Reverse proxy: inbound requests for a service

A reverse proxy accepts requests addressed to a service and forwards them to backend servers. Clients normally connect to the service endpoint; they do not choose or address an individual backend directly. The service operator configures the reverse proxy and its routes. [NGINX Beginner’s Guide]

A reverse proxy can route to multiple backends, with optional caching or load distribution configured as needed.
A reverse proxy can route to multiple backends, with optional caching or load distribution configured as needed.

What it can do

  • Route requests: send requests to the backend that serves a hostname, path, or other configured rule.
  • Distribute load: direct requests among multiple application instances when the chosen implementation is configured for load balancing.
  • Cache content: reuse eligible responses when caching is supported and configured for the application.
  • Handle connection details: control upstream headers, request bodies, buffering, and timeouts, depending on the proxy and its configuration.

These are capabilities, not automatic properties of every reverse proxy. For example, NGINX’s load-balancing documentation describes round-robin as the default when no method is explicitly configured, and documents passive health checks that temporarily avoid a server after communication failures. Those details apply to NGINX as documented; check the documentation for your product, edition, and version before relying on equivalent behavior. [NGINX load balancing]

4. Side-by-side comparison

Question Forward proxy Reverse proxy
Whom does it represent? A client or client network One or more backend servers
Typical request path Client → proxy → external destination Client → proxy → backend
Who configures it? Client, endpoint administrator, or network team Service operator or hosting team
Common policy focus Outbound access, monitoring, and client network rules Inbound routing and service delivery
What does the client address? The client is configured to use the proxy The service endpoint in front of the proxy
Typical optional features Access rules and logging Routing, load distribution, caching, or health handling

Visibility depends on configuration. A forward proxy operator can observe the traffic that clients send through it; external destinations may receive the proxy address and any forwarded client information. A reverse proxy operator can observe incoming requests and decide which request details reach each backend. Review TLS handling, headers, and logs on both sides of the proxy. [MDN; NGINX proxy module]

5. Choose the role that matches your architecture

  1. Identify the traffic you want to mediate. If clients need managed access to outside destinations, evaluate a forward proxy. If requests for your application need to reach backend servers, evaluate a reverse proxy.
  2. Identify who should control the proxy. Client or network teams commonly manage forward-proxy settings. The service team commonly manages reverse-proxy routes and upstream behavior.
  3. List the required behaviors. Specify access rules, logging, routing, caching, load distribution, health handling, or TLS requirements. Confirm the chosen implementation supports each one and that you will configure it.
  4. Check what each party can see. Decide what client details reach an external destination or backend. Inspect headers, TLS termination, and logs as part of the design.
  5. Check application protocols. Confirm the proxy supports your HTTP behavior, headers, connection handling, and any application protocol such as WebSockets.
  6. Plan for failure. Define timeouts, backend health behavior, useful logs, and what clients should receive when the proxy or an upstream is unavailable.

6. Configure a basic NGINX reverse proxy

This example shows the reverse-proxy role: NGINX listens for requests and passes them to an application server at 127.0.0.1:3000. It assumes NGINX is installed, the application is reachable at that address, and you can edit the NGINX configuration. Adapt the server name and upstream address for your deployment; validate directives against the NGINX version and configuration layout you use.

server {
    listen 80;
    server_name example.com;

    location / {
        proxy_pass http://127.0.0.1:3000;
        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;
    }
}

In this setup, clients address example.com. NGINX forwards matching requests to the application; the application does not need to be publicly exposed just to receive those proxied requests. The proxy module documents controls for the upstream address, headers, request bodies, buffering, timeouts, and cache behavior. Choose those settings for your application instead of assuming one set of defaults fits all workloads. [NGINX proxy module documentation]

WebSocket requests need explicit handling in NGINX

WebSocket Upgrade and Connection are hop-by-hop headers. NGINX’s documented reverse-proxy setup requires explicitly passing them when proxying WebSockets. Add a mapping in the http context and the headers in the relevant location:

map $http_upgrade $connection_upgrade {
    default upgrade;
    ''      close;
}

server {
    listen 80;
    server_name example.com;

    location /ws/ {
        proxy_pass http://127.0.0.1:3000;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection $connection_upgrade;
        proxy_set_header Host $host;
    }
}

Use the NGINX documentation for your version and review the complete application requirements, including TLS and timeouts. Do not assume ordinary HTTP proxy configuration automatically handles every upgraded connection. [NGINX WebSocket proxying]

7. Or skip the browser setup

For capturing a rendered page as an image, you can run a browser yourself, or use ScreenshotNeo, a website screenshot API and MCP server for developers. A single GET request returns a PNG, JPEG, WebP, or PDF. The API uses familiar parameter names supported by other screenshot APIs, which can make switching easier. See the ScreenshotNeo API docs for options and configuration.

curl -G "https://api.screenshotneo.com/v1/shot" \
  -d access_key=YOUR_API_KEY \
  --data-urlencode url=https://stripe.com \
  -o shot.webp
import requests

r = requests.get(
    "https://api.screenshotneo.com/v1/shot",
    params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"},
    timeout=90,
)
open("shot.webp", "wb").write(r.content)
const q = new URLSearchParams({
  access_key: 'YOUR_API_KEY',
  url: 'https://stripe.com'
});
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);
if (!res.ok) throw new Error(`Screenshot request failed: ${res.status}`);
const bytes = new Uint8Array(await res.arrayBuffer());
await import('node:fs/promises').then(fs => fs.writeFile('shot.webp', bytes));

ScreenshotNeo accepts cookie and consent banners like a visitor and removes 60+ known consent platforms, newsletter popups, and chat widgets before capture; each step can be turned off. Bot checks and CAPTCHAs, blank pages, timeouts, failed loads, and cache hits cost nothing. Response headers say whether a page was clean and whether it was billed. An MCP server provides take_screenshot, get_page_info, and capture_pdf for Claude, Cursor, and other MCP clients. The free plan includes 1,000 screenshots a month with no card; paid plans start at $5 for 3,000. Sign up for 1,000 free screenshots a month, no card required.

8. Troubleshooting proxy deployments

Symptom Likely cause What to check
Client cannot reach an external destination through a forward proxy Client proxy settings, network reachability, or proxy access rules are incorrect Confirm the client is configured for the right proxy and port; inspect proxy logs and outbound policy.
Reverse proxy returns a gateway error The configured upstream is unavailable or unreachable, or the request exceeds a configured timeout Check that the application is listening at the configured address, test connectivity from the proxy host, and inspect upstream error logs and timeout settings.
Application sees the wrong host or client address Forwarding headers are missing, overwritten, or interpreted incorrectly Inspect the headers the proxy sends and the application’s trusted-proxy configuration. Do not trust arbitrary client-supplied forwarding headers.
WebSocket connection fails after the initial request Upgrade handling is missing or the connection is closed by proxy or upstream settings For NGINX, check explicit Upgrade and Connection forwarding and follow its WebSocket guide for your version.
Responses are stale or unexpectedly cached Cache behavior is enabled or inherited with rules that do not match the application’s content Review cache configuration, cache keys, and response headers; disable or narrow caching where personalized content must not be reused.
Some requests time out while others succeed Slow upstream work, proxy timeout settings, or intermittent backend health issues Compare proxy and application logs by request, check upstream response times, and tune timeouts only after identifying the slow operation.
Configuration reload fails Syntax error, directive in the wrong context, or version mismatch Run the configuration test command for your NGINX installation, read the reported file and line, and compare directives with documentation for the installed version.

9. Performance, reliability, and cost considerations

A proxy adds a network hop and a component that must be operated. Its effect on latency or throughput depends on network placement, traffic, implementation, and configuration; there is no source-supported universal speed advantage for either proxy type. Measure representative requests and inspect the proxy and upstream separately.

For a reverse proxy, caching can reduce repeated backend work when responses are safe to reuse. Load balancing can distribute requests across instances, but it does not by itself make an application highly available: the backend instances, health handling, state management, and proxy’s own availability matter. NGINX documents its particular load-balancing and passive health-check behavior; consult the corresponding documentation for other software. [NGINX load balancing]

Set explicit operational expectations for connection and read timeouts, request buffering, and failure responses. Log enough information to trace an upstream failure while respecting privacy and data-retention rules. For both proxy roles, access controls, TLS choices, patching, and logging shape security. Neither role is inherently safer. [NGINX proxy module]

Cost is implementation-specific: account for proxy infrastructure, bandwidth, observability, maintenance, and any commercial software or support. The research sources provide no comparable market prices or performance benchmarks, so choose using measured requirements and the terms of the options you evaluate.

10. Frequently asked questions

Can the same software act as both kinds of proxy?

Yes. Forward and reverse describe the proxy’s role in a traffic path, not a unique software product. A product may support multiple modes; configure and secure the mode your architecture requires.

Does a reverse proxy always hide the backend?

It can keep clients from directly addressing backend servers, but that depends on network exposure and routing. Ensure the backend cannot be reached through unintended paths if isolation is part of your design.

Is a forward proxy the same as a VPN?

No. A forward proxy mediates requests at the protocols it supports. VPNs can route traffic at different network layers and have distinct behavior. Pick based on the traffic and security properties you need.

Does a reverse proxy automatically provide TLS termination or protection?

No. TLS handling and filtering depend on the selected implementation and configuration. Specify where TLS is established, how traffic is protected to the backend, and which controls are enabled.

Which one should I use for a web application?

Use a reverse proxy when you need an intermediary in front of your application servers to route incoming service requests. Use a forward proxy when your goal is to mediate clients’ outbound access to external destinations. Some organizations use both for different traffic paths.