proxy - ghdrako/doc_snipets GitHub Wiki

A proxy server is an intermediary piece of hardware/software sitting between the client and the backend server. It receives requests from clients and relays them to the origin servers. Typically, proxies are used to filter requests, log requests, or sometimes transform requests (by adding/removing headers, encrypting/decrypting, or compression).

There are two types of proxies:

  • Forward Proxy
  • Reverse proxy

A traditional forward proxy server allows multiple clients to route traffic to an external network. For instance, a business may have a proxy that routes and filters employee traffic to the public Internet. A reverse proxy, on the other hand, routes traffic on behalf of multiple servers

Forward Proxy

A forward proxy, often called a proxy, proxy server, or web proxy is a server that sits in front of a group of client machines. When those computers make requests to sites and services on the internet, the proxy server intercepts those requests and then communicates with web servers on behalf of those clients, like a middleman.

                                                    --> server 1
client group ----> forward proxy ---> internet ----|--> server 2 
                                                    --> server 3

Advantages

  • Block access to certain content
  • Allows access to geo-restricted content
  • Provides anonymity
  • Avoid other browsing restrictions

Reverse Proxy

A reverse proxy is a server that sits in front of one or more web servers, intercepting requests from clients. When clients send requests to the origin server of a website, those requests are intercepted by the reverse proxy server.

                                                    --> server 1
client group ---->  internet ---> forward proxy ---|--> server 2 
                                                    --> server 3

The difference between a forward and reverse proxy is subtle but important. A simplified way to sum it up would be to say that a forward proxy sits in front of a client and ensures that no origin server ever communicates directly with that specific client. On the other hand, a reverse proxy sits in front of an origin server and ensures that no client ever communicates directly with that origin server.

Advantages

  • Improved security
  • Caching
  • SSL encryption
  • Load balancing
  • Scalability and flexibility

Example: