Stage 2 · Lesson 7 of 8
Nginx as reverse proxy and load balancer
A sits in front of your app. It accepts requests from the internet and passes them to the app on a private port. Nginx is the common choice.
It handles TLS, serves static files such as images quickly, and adds such as X-Forwarded-For so the app knows the real visitor's address. With an upstream block it also works as a , spreading traffic across several copies of the app.
A minimal site is a server block with server_name, listen 443 ssl and location / { proxy_pass http://127.0.0.1:3000; }. Always run nginx -t to test the config before reloading, so a typo does not take the site down. A cloud load balancer or a does the same job later, so the ideas carry over.
Common trapforgetting timeouts and body size limits, which show up as mysterious 504s and 413s.
A question to check yourself, an AI practice session and 1 cheat sheet entry come with the full roadmap. Unlock
Resources for this stage
Start with
- VideoFreeComputer Networking: A Top-Down Approach (Video Lectures)
Jim Kurose and Keith Ross · Intermediate
Free lectures from the textbook authors; chapters 1 to 4 cover what DevOps needs
Practise
Keep handy
Also worth your time
- Load Balancer vs. Reverse Proxy vs. API Gateway: Demystifying Web Architectures (opens in a new tab)Read
Separates three components people often mix up, and what each one is for