Backend Development 11 min read

Understanding Nginx: History, Proxy Types, and Load‑Balancing Algorithms

This article explains the origins of Nginx, compares it with Apache, describes forward and reverse proxy concepts, and details Nginx's load‑balancing mechanisms and algorithms, providing a comprehensive overview of how Nginx serves as a high‑performance web and proxy server.

Top Architect
Top Architect
Top Architect
Understanding Nginx: History, Proxy Types, and Load‑Balancing Algorithms

Origin of Nginx

Nginx was created by Russian engineer Igor Sysoev in C while working at Rambler Media, and later open‑sourced under a free software license, gaining popularity for its lightweight, event‑driven architecture.

Why Nginx Became Popular

Event‑driven design supports millions of TCP connections.

Modular architecture and open‑source licensing encourage third‑party modules.

Cross‑platform support (Linux, Windows, FreeBSD, Solaris, AIX, macOS, etc.).

High stability and performance.

Proxy Concepts

Forward Proxy : Acts on behalf of the client, hiding client identity; the client must configure the proxy’s IP and port.

Reverse Proxy : Sits in front of backend servers, hiding server details; clients are unaware of its presence and no special configuration is needed.

Use Cases of Proxies

Accessing resources blocked abroad (e.g., Google).

Caching to accelerate resource retrieval.

Client access authorization and authentication.

Recording user access for behavior management.

Load Balancing in Nginx

Nginx can act as a reverse proxy and distribute incoming requests across multiple backend servers using various algorithms.

Supported Load‑Balancing Algorithms

weight (round‑robin) : Default; distributes requests sequentially, with optional weight values to favor certain servers.

ip_hash : Routes requests based on the hash of the client’s IP, ensuring the same client reaches the same backend server.

fair : Dynamically assigns requests based on server response time (requires the upstream_fair module).

url_hash : Distributes based on the hash of the request URL, improving cache efficiency (requires the appropriate hash module).

Additional Topics

The article also mentions hardware vs. software load balancers, the role of Nginx in large‑scale deployments such as Taobao’s Tengine, and provides a brief comparison with Apache.

http://tengine.taobao.org/

proxybackend developmentload balancingNginxWeb Server
Top Architect
Written by

Top Architect

Top Architect focuses on sharing practical architecture knowledge, covering enterprise, system, website, large‑scale distributed, and high‑availability architectures, plus architecture adjustments using internet technologies. We welcome idea‑driven, sharing‑oriented architects to exchange and learn together.

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.