Proxy server
Прокси-сервер
A network intermediary that accepts requests from a client, forwards them when needed, and sends responses back to the client.
Also known as: прокси
What a proxy server does
A proxy sits between a client, such as a browser, and the server the client wants to reach. Instead of connecting directly to that server, the client connects to the proxy. The proxy can relay the request, deny it under an access policy, or serve a cached response when caching rules allow it.
Forward and reverse proxies
A forward proxy acts on behalf of clients. For example, an organization might configure build tools to send outbound requests through a corporate proxy. The proxy can enforce which package registries those tools may contact and log the destinations they request.
A reverse proxy sits in front of a service. A browser connects to the public address of an application without needing to know which backend will handle the request. For instance, Nginx might send /api/ requests to an application server and /assets/ requests to a static file server. Either path can have one backend or several: load balancing is something a reverse proxy can do, not what makes it a proxy.
The distinction is whose traffic the proxy manages. Both types carry traffic in both directions.
Example: where HTTPS is decrypted
Suppose a browser needs to open https://docs.example through an HTTP forward proxy. It sends CONNECT docs.example:443 to ask the proxy for a tunnel. If the proxy permits the request and reaches the destination, the browser performs the TLS handshake with the site through that tunnel. The proxy knows the requested host and port, but in this setup it relays encrypted bytes rather than reading the HTTP messages inside them.
Contrast that with a reverse proxy that terminates TLS. The browser establishes TLS with the proxy itself, so the proxy can read the HTTP request and route it based on its path. Whether the connection from the proxy to the backend also uses TLS is a separate decision.
Common misconceptions
- A proxy is not a VPN. A browser's proxy setting does not automatically cover other applications. A VPN creates a network tunnel, and routing rules determine which traffic uses it.
- A proxy does not guarantee anonymity. The destination ordinarily sees the proxy's outgoing IP address as its network peer, but request headers, cookies, or an account login can still identify the client. The proxy may also keep logs.
What interviewers ask
A common scenario: every request in the backend's access log appears to come from the same IP. Draw the two connections: client to reverse proxy, then reverse proxy to backend. The backend logs the address of its immediate peer, which in this setup is the proxy. If the application needs the client's IP, the proxy can pass it in a header such as Forwarded or X-Forwarded-For. Explain the trust boundary as well: the backend should interpret those headers only through a configured chain of trusted proxies, not accept an arbitrary value supplied by the client.