---
type: archive
area: archive
status: archived
date: 2026-05-03
created: 2026-05-03
updated: 1980-01-01
tags:
  - archive
---
# Understanding Proxies: Forward and Reverse

## What is a Proxy?

A proxy server acts as an intermediary between client machines and the Internet. There are two common types of proxies: forward proxies and reverse proxies. Each serves different purposes in network communication.

## Forward Proxy

A forward proxy is a server that sits between a group of client machines and the Internet. When these clients make requests to websites, the forward proxy intercepts the requests and communicates with the web servers on behalf of the clients.

### Benefits of a Forward Proxy

1. **Online Identity Protection**: The forward proxy hides the client's IP address, making it difficult to trace the client's identity. Only the IP address of the proxy is visible to the web servers.
    
2. **Bypassing Restrictions**: Institutions like governments, schools, and businesses often impose browsing restrictions. By connecting through a forward proxy, clients can potentially bypass these restrictions, although firewalls may still block connections to the proxy.
    
3. **Content Filtering**: Forward proxies can be used to block access to certain content. Schools and businesses may configure their networks to route all client traffic through a proxy, applying filtering rules to block specific sites like social networks.
    

### Transparent Proxies

In large institutions, transparent proxies are often used to streamline the process. These proxies work with layer 4 switches to automatically redirect certain types of traffic to the proxy without requiring client configuration. When on an institution's network, it is difficult to bypass a transparent proxy.

## Reverse Proxy

A reverse proxy sits between the Internet and web servers, intercepting client requests and communicating with the web servers on the clients' behalf.

### Benefits of a Reverse Proxy

1. **Website Protection**: By hiding the website's IP addresses behind the reverse proxy, it becomes harder to target the website with DDoS attacks.
    
2. **Load Balancing**: Reverse proxies distribute incoming traffic across multiple servers, preventing any single server from becoming overloaded. This is essential for popular websites handling millions of users.
    
3. **Content Caching**: Reverse proxies can cache static content, allowing them to quickly serve repeated requests by returning the cached version.
    
4. **SSL Encryption Handling**: SSL encryption is computationally expensive. Reverse proxies can handle SSL handshakes, freeing up the origin servers from these demanding operations.
    

### Multi-layer Reverse Proxies

For modern websites, it is common to deploy multiple layers of reverse proxies. The first layer might be an edge service like Cloudflare, with reverse proxies positioned close to users around the world. The second layer could be an API gateway or load balancer at the hosting provider, with traffic evenly distributed across a cluster of web servers.

### This is a configuration about load balancer  using round robin algorithm
```c
# Balance requests across three servers in a group named "uuid"
# Use the same IP address for each server: 127.0.0.1
# Use a different port for each server: 9001, 9002, and 9003
upstream uuid {
    server 127.0.0.1:9001;
    server 127.0.0.1:9002;
    server 127.0.0.1:9003;
}

server {
    listen 80;

    # Add a location directive here to serve requests from "/uuid"
    # Inside the location, connect to the group named "uuid"
    location /uuid {
        proxy_pass http://uuid/;
    }
}
```
- For a reverse proxy configuration we only define one server and automatically nginx act as reverseproxy
