Machine Room

Forward Proxy vs Reverse Proxy

Both are a box in the middle, between you and a website. A forward proxy works for the client, a reverse proxy works for the servers. The one-page notes from the reel.

Download the PDF

One-page notes, Forward Proxy vs Reverse Proxy. Both are a box in the middle, between you and a website. The difference is whose side the box is on. 1, Same kind of box, opposite sides. you. forward proxy. reverse proxy. example.org. A forward proxy is chosen by the client, and it works for the client. A reverse proxy is put there by the website, and it works for the servers. RFC 9110 calls both an HTTP "intermediary": a proxy, and a gateway (a.k.a. "reverse proxy"). 2, Forward proxy: the office's box. office. client. Wi-Fi router. forward proxy. ≠. The company wants every request from its laptops to leave through one point. Each laptop is set up to send its requests to this box first. The box isn't the Wi-Fi router. It's a server the company runs. RFC 9110: a proxy is "chosen by the client, usually via local configuration rules". 3, Reverse proxy: the website's front door. you. example.org. reverse proxy. server 1, server 2, server 3. A website runs on several servers, and it wants one front door for all of them. To you, the box looks like the website itself. It passes your request to a server behind it, and sends the answer back. RFC 9110: a gateway (a.k.a. "reverse proxy") "acts as an origin server for the outbound connection". 4, What the forward proxy does. request. example.org. saved copy. allowed. refused. The box fetches the page on the laptop's behalf, or answers from a copy it saved earlier. RFC 9112: the proxy will "service that request from a valid cache, if possible, or make the same request on the client's behalf". It decides who's allowed to use it. Anyone else is refused. Squid, a caching proxy: "If there are no "access" lines present, the default is to deny the request.". 5, What the reverse proxy is for. caching. server 1, server 2, server 3. load balancing. It can save copies of pages, so answers come back faster. That's caching. It can spread requests across many servers. That's load balancing. RFC 9110: gateways "improve server performance through "accelerator" caching" and "enable partitioning or load balancing of HTTP services across multiple machines". NGINX: "To pass requests to a server group, the name of the group is specified in the proxy_pass directive.". 6, Side by side. forward proxy | reverse proxy. Who put it there | the client | the website. Stands in for | the client | the server. Sits | next to the clients | in front of the servers. Jobs | one exit point, saved copies, who's allowed | caching, load balancing. Software | Squid (port 3128) | NGINX (proxy_pass), Squid (accel mode). 7, One program, either side. Squid normally listens on port 3128 as a forward proxy, and it has an "accel Accelerator / reverse proxy mode". RFC 9110: "a single intermediary might act as an origin server, proxy, gateway, or tunnel, switching behavior based on the nature of each request". Same kind of box, opposite sides. A forward proxy stands in for the client. A reverse proxy stands in for the server.

On a phone, press and hold the image to save it.