Roadmap › Networking & Hosting — How a Website Works, End to End › Module: Infrastructure Between the User and the App
Lessons in this course (12)

8. Proxies, reverse proxies, load balancers, CDNs and firewalls

Intermediate★ Must knowLesson 8 of 12
ComponentSitsDoes
Forward proxyNear the clientClients go out through it (corporate filtering, caching)
Reverse proxyIn front of serversReceives client requests and forwards to backend servers: TLS termination, compression, caching, routing (Nginx, IIS ARR, YARP, Azure Application Gateway)
Load balancerIn front of a server poolDistributes traffic: round robin, least connections, IP hash; health probes remove dead servers. L4 (TCP) or L7 (HTTP)
CDNEdge locations worldwideCaches static (and some dynamic) content close to users: Cloudflare, Azure Front Door, Akamai, CloudFront
Firewall / NSGNetwork boundaryAllows/blocks by IP/port
WAFLayer 7Blocks SQL injection, XSS, bots (Azure WAF, Cloudflare WAF)
API gatewayIn front of APIsAuth, rate limiting, routing, versioning (Azure API Management)
text
User ─▶ DNS ─▶ CDN/WAF (edge) ─▶ Load balancer ─▶ [Web server 1 | Web server 2 | Web server 3] ─▶ SQL Server

Behind a proxy the app sees the proxy's IP — read the original client IP and scheme from X-Forwarded-For / X-Forwarded-Proto (ASP.NET Core: UseForwardedHeaders).