Sadeen Faqih & Mohammadkhair Awwad. This is the slide deck. On a phone, the interactive part is the live page.
One front door for a distributed system.
It answers every caller and connects each one to a healthy backend. Theory, step-by-step simulations, then a live server you can hit from your phone.
A web server, reverse proxy, cache and load balancer in one small event-driven C program.
Six jobs, one process
A few long-lived processes, not one thread per visitor.
Clients only ever talk to nginx. Backends only ever talk to nginx.
The phone sends
backend-2 receives
Blocks inside blocks; settings flow inward unless a block overrides them.
user www-data; worker_processes auto;
worker_connections 768;include /etc/nginx/sites-enabled/*; ← our file lands here
server 127.0.0.1:9101;
server 127.0.0.1:9102;
server 127.0.0.1:9103;listen 80; root /var/www/bzu.awwad.si;
proxy_pass http://bzu_rr;proxy_cache bzu_cache;bzu_.nginx -t before reload.Sticky routing that survives a backend leaving.
Passive health checks: real requests are the probes. (Active checks are NGINX Plus only.)
Answer repeated questions without asking the backend.
The front door is one point of failure, so real systems run more than one.
On a real VPS that already serves 8 other sites. Nothing else may break.
A bzu → 57.129.172.197sudo docker compose up -dsudo cp -r site/. /var/www/bzu.awwad.si/sudo cp nginx/bzu.awwad.si.conf /etc/nginx/sites-available/bzu.awwad.si
sudo ln -s /etc/nginx/sites-available/bzu.awwad.si /etc/nginx/sites-enabled/sudo nginx -t && sudo systemctl reload nginxcurl -H "Host: bzu.awwad.si" http://127.0.0.1/api/hellosudo certbot --nginx -d bzu.awwad.si --redirectsudo tail -f /var/log/nginx/bzu.access.logbzu.awwad.si/live
Open it on your phone and press Send a request. You'll see which backend answered, and every header nginx added.
sudo docker stop bzu-backend-2Its bar says DOWN; your phone still gets answers.| Built for | Notable | |
|---|---|---|
| nginx | web server + reverse proxy + cache in one | event loop, static config + graceful reload; active health checks and a live API are in the paid NGINX Plus |
| HAProxy | dedicated TCP/HTTP load balancer | active health checks and a detailed stats page in the open-source version |
| Envoy | service meshes and microservices | configured live over an API (xDS); the data plane of Istio |
| Caddy | simple sites with automatic HTTPS | gets and renews certificates by default; written in Go |
| Apache httpd | general web server with modules | prefork / worker / event models, per-directory .htaccess |
Questions?
Sources