Начать пробный период
Назад

What Is a Reverse Proxy? Architecture, Uses, and Security

Обобщите эту статью с помощью предпочитаемого вами AI
Попробуйте наши премиум-прокси

Протестируйте наши премиум-прокси без ограничений по качеству.

  • Мобильные и резидентные прокси
  • Таргетинг на уровне ZIP
  • Статические и ротируемые IP
  • Встроенный фильтр качества
Попробовать сейчас

A reverse proxy is a server that sits in front of one or more backend servers and handles client requests on their behalf. Visitors connect to the proxy, and the proxy talks to the servers that actually run the website or application. Think of it as the public front door of a site, with the real machines kept out of sight.

Need a proxy for your requests?
Try NodeMaven residential proxies for reliable access to web data with flexible location targeting

Попробовать сейчас

Что такое обратный прокси-сервер?

A reverse proxy receives requests from clients such as browsers and mobile apps, decides which backend server should handle each one, and passes the backend’s response back as if it came from the proxy itself. The client never needs to know how many servers exist or where they run.

Without a reverse proxy, a browser connects straight to the origin server, the machine that holds the site’s code and data. Every backend then needs its own public address and its own exposure to the internet. With a reverse proxy, only the proxy has to be reachable from outside.

Here is a simple example. A company runs its marketing site, a customer API, and an admin panel on three separate machines. Everyone visits example.com. The proxy sends /api requests to the API servers, /admin to the admin panel, and everything else to the website.

Forward proxy vs. reverse proxy

A forward proxy acts for the client. The client is set up to send its requests to the proxy, which then contacts websites on its behalf. The website sees the proxy’s IP address instead of the client’s. People use forward proxies to reach content restricted by location or network, as covered in this guide to unblocking websites, or to filter traffic inside an organization.

A reverse proxy acts for the server. Clients configure nothing. They request an ordinary URL, and the proxy answers it. Site owners use reverse proxies to spread load, cache content, and keep backend servers out of direct reach.

Forward proxyОбратный прокси
Position in the request flowBetween clients and the internetBetween the internet and backend servers
Основное назначениеControl or change how clients reach external sitesManage, protect, and speed up access to a site’s servers
Типичные случаи использованияGeo-targeted browsing, content filtering, web data collectionLoad balancing, caching, TLS termination, routing
Whose traffic or infrastructureOutbound traffic from a user or organizationInbound traffic to the site owner’s infrastructure
Who sets it upThe client or the client’s networkThe site owner

NodeMaven provides forward proxies, not reverse proxy infrastructure. Резидентские прокси NodeMaven and mobile proxies send a client’s requests to external websites through different IP addresses and locations.

That helps with geographically targeted SEO monitoring, web scraping, ad verification, and market research.

Which IP type fits depends on the target site, as this comparison of mobile, residential, and datacenter proxies explains.

How does a reverse proxy work?

  1. A client sends a request. A browser asks for https://example.com/ products. DNS points that name at the reverse proxy, not at a backend.
  2. The proxy receives it. For HTTPS traffic, the proxy typically completes the TLS handshake here. This is called TLS termination.
  3. The proxy picks a backend. It matches the request against its rules, such as hostname, path, or headers, and finds the group of servers that can answer. If a group has several servers, a load-balancing method like round robin or least connections chooses one.
  4. The backend processes the request. The proxy forwards it, often over a private network. It usually adds a header such as X-Forwarded-For so the backend can still see the original client address.
  5. The response returns through the proxy. The proxy may cache it, compress it, or adjust headers before sending it to the client.

TLS termination means the proxy decrypts incoming HTTPS traffic and forwards plain HTTP to the backends, or re-encrypts it for the internal leg. It keeps certificate management in one place. Whether the internal leg needs encryption depends on how far you trust your internal network.

Request routing is the rule matching in step 3. One proxy can serve many hostnames and paths, which is how a single public address fronts a whole set of services.

Make web requests more reliable.
Access residential and mobile IPs with flexible targeting and session options

Попробовать сейчас

What is a reverse proxy used for?

A reverse proxy can do all of the following, but not every one does. What it does depends on how it is configured.

  • Load balancing. It spreads requests across several servers so no single one is overwhelmed, and it can skip servers that fail health checks.
  • Caching. It stores copies of responses and serves repeat requests without bothering the backend.
  • TLS/SSL termination. It takes over encryption work from the application servers.
  • Routing. It sends different hostnames or paths to different applications or services.
  • Access control. It can apply IP allow lists, rate limits, and authentication before a request reaches the application.
  • Reduced exposure. Backend servers can sit on a private network, with only the proxy reachable from outside.

Benefits and security limitations of a reverse proxy

The benefits are mostly practical. Caching and TLS offloading can improve response times. You can add or remove backend servers without changing the public address. Logging, rate limiting, and authentication live in one place instead of in every application. And hiding origin servers behind the proxy shrinks the surface an attacker can reach directly.

The limits matter just as much:

  • A reverse proxy does not secure an application by itself. It forwards whatever requests it allows, including malicious ones. Filtering attacks takes extra rules or a separate web application firewall.
  • Origin servers stay exposed if they accept direct connections. Restrict them so they only accept traffic from the proxy.
  • The proxy can become a single point of failure unless you run more than one.
  • It adds a network hop and another layer to configure. Mistakes, such as trusting client-supplied X-Forwarded-For values, can create problems.
  • It protects the server’s identity, not the visitor’s. A reverse proxy does not make anyone anonymous.

Reverse proxy vs. load balancer vs. API gateway

Обратный проксиБалансировщик нагрузкиAPI gateway
Core jobFront backend servers and relay requests and responsesDistribute traffic across several serversManage access to APIs and services
Typical featuresRouting, caching, TLS termination, header changesHealth checks, balancing algorithms, failoverAuthentication, rate limits, request transformation, usage analytics
Useful with one server?ДаRarelyYes, for API management

These roles overlap, so they are not mutually exclusive. Load balancing is a function, and many reverse proxies include it. Some dedicated load balancers work at the TCP level and never read HTTP. An API gateway is usually a reverse proxy with API-specific features added. The same tool can often play all three roles depending on configuration.

Two neighbors are worth separating. A CDN often runs on reverse proxies but adds a globally distributed cache. A web application firewall inspects requests for attack patterns, and some reverse proxies offer one as an add-on.

  1. Nginx

A widely used web server that also works as a reverse proxy, with routing, caching, and load balancing. Its documentation on configuring a reverse proxy охватывает proxy_pass, headers, and buffering.

2. Caddy

Offers a reverse_proxy directive with built-in load balancing and health checks, and it is known for automatic HTTPS.

3. Cloudflare

A managed service. When a site’s traffic runs through its network, Cloudflare acts as a reverse proxy in front of the origin, alongside CDN caching and attack protection.

4. Apache HTTP Server

Works as a reverse proxy through mod_proxy и ProxyPass directive, with load balancing added through mod_proxy_balancer.

5. Traefik

A popular in container and Kubernetes setups, where services come and go and routing needs to keep up.

6. HAProxy

 Best known as a high-performance load balancer that also proxies TCP and HTTP traffic.

Ready to get started with proxies?
Начните пробный период NodeMaven за $3.50 и получите 750 MB премиального прокси-трафика

Попробовать сейчас

Часто задаваемые вопросы

It acts for the server side of a connection, the opposite of a forward proxy, which acts for the client side.

Not by default. It can enforce rules such as IP allow lists and rate limits, and some products add firewall features, but a plain reverse proxy mainly relays traffic.

No. It hides the addresses of the servers behind it, not those of visitors. To change the IP a website sees, you need a forward proxy, such as the rotating setups described in this rotating proxies guide.

Often it still helps. One proxy can handle TLS, caching, and rate limits, and let several applications share one public address.

Both. Nginx can serve static files directly and proxy other requests to application servers.

Most CDNs work as reverse proxies, with the addition of caches spread across many locations.

Вам также могут понравиться эти статьи

Этот сайт использует Файлы cookie чтобы улучшить ваш опыт. Продолжая, вы соглашаетесь на использование файлов cookie.