Stop nodding along in meetings. Here is the dead-simple, no-jargon breakdown of what proxies actually do and why nginx is at the front door of every app.
Hey fellow devs! Let’s talk about something we’ve all done: nodding along in a meeting when someone mentions a "proxy," while secretly having only a vague idea of how it actually works.
For a long time, it was just filed under the "networking magic" folder in my brain. I knew nginx sat "in front of" my app somehow, and I knew VPNs hid my location. I just assumed they were basically the same thing.
They aren't. They’re actually closer to opposites.
Once the distinction clicks, a ton of tools you use every day suddenly make complete sense. Let's break it down without the academic jargon.
Start With the Word Itself
A proxy, at its simplest form is a stand-in.Something that acts on behalf of someone else.
That's it.That's the whole concept.Everything else is just:on behalf of whom,exactly?
That single question splits proxies into two completely different tools.
Forward Proxy:Standing in for the User
A forward proxy sits infront of a client(you,your laptop,your browser) and makes requests to the internet on your behalf.
Picture sending a friend to buy something for you instead of you going yourself.The shop only sees your friend ,it doesn't know who actually wants the item or why.
Thats a forward proxy.Your request goes to the proxy first.The proxy forwards it to the actual destination,gets the response, and hands it back to you.From the destination's point of view,the proxy is the one asking not you.
This is the set up behind things like this:
Corporate networks - a company routes all employee traffic through a proxy to monitor or restrict what sites are accessible.
VPNs - functionally a forward proxy with encryption layered on top;your traffic exits from the VPN,s location, not your actual one.
Bypassing geo-restrictions - routing your request through a proxy in another country makes you appear to be browsing from there.
Anonymity tools - services designed to hide the original requesters identity from the destination.
The theme across all these:The proxy hides the client from the server.The destination sees the proxy,it doesnt see you.
Reverse Proxy:Standing In for The Server
A reverse proxy does the mirror-image job.It sits in front of a server(or a group of servers) and receives requests on the server's behalf.
Same shopping analogy,flipped.Now imagine a single receptionist standing infront of an office building,taking every visitors request and deciding which internal department actually handles it.Visitors talk to the receptionist.They never learn or need to know which specific desk,floor or person is doing the actual work behind the scenes.
That receptionist is your reverse proxy.Requests arrive at it first.It decides where they actually go(which backend server,which service)fetches the response and hands it back to the user.From the user's point of view,they were just talking to the website.They have no idea a reverse proxy was involved,let alone how many real servers exist behind it.
This time, the them flips:The proxy hides the server from the client.
This is exactly what nginx is doing in most setups.Its the receptionist standing in front of your actual application,deciding what happens to each incoming request before your app code ever sees it.
The One -Line Way to Never Confuse Them Again
Here's the distinction i wish someone had just said to me plainly,instead of making me piece it together from documentation:
Forward proxy -> works fro the client,hides the client from the internet.
Reverse proxy -> works for the server,hides the server from the internet.
Same mechanisms,sits in the middle,forward the request,pointed in opposite directions.Thats genuinely the entire conceptual difference.Everything below is just what you do with it once its in place.
So what is Nginx Actually doing All Day?
If you have deployed literally anything, you've probably had nginx (or something like it) sitting in front of your app without fully knowing why it needed to be there. Here's the job list:
Hiding your real server setup. Users hit nginx. nginx decides, silently, which backend actually handles it. You could have one server or fifty behind it, nobody outside can tell, and that's the point.
Load balancing. This is where reverse proxies and load balancers overlap so much people use the terms interchangeably. nginx can distribute incoming requests across multiple backend instances, everything from Part 2, implemented via a reverse proxy.
SSL/TLS termination. Handling HTTPS encryption is genuinely expensive computationally. Reverse proxies commonly handle the encryption/decryption once, at the edge, then talk to internal servers over plain, unencrypted HTTP inside your own trusted network. Your app code doesn't have to think about certificates at all.
Serving static files directly. Images, CSS, JS, nginx can hand these out itself without ever bothering your actual application server. Faster, and it keeps your app free to focus on real logic.
Caching responses. Similar spirit to the CDN from Part 1, but local, nginx can cache responses itself and skip hitting your backend for repeat requests.
Compression. Squeezing responses with gzip or brotli before they leave the server, cutting how much data has to travel.
Routing based on the URL. /api/* goes to your backend service. / goes to your frontend. /admin goes to a completely different internal service. One entry point, many destinations, invisible to the visitor.
Notice how many of these have nothing to do with "picking a server", that's only the load-balancing use case. A reverse proxy is a much broader tool that load balancing happens to be one job for.
A Concrete Before-and-After
Without a reverse proxy, your Node/Go/whatever app server talks directly to the internet. It has to handle HTTPS itself, serve its own static files, deal with malicious traffic directly, and has no protection if a specific server instance goes down. Every one of those is a job your app was never really designed to do.
With a reverse proxy in front of it, your app only ever talks to nginx, on your own internal network, over plain HTTP, and only receives requests nginx has already decided are legitimate and ready to be handled. Your app gets to just be an app. Everything else — encryption, routing, static files, load distribution, is handled by something built specifically for that job.
This is a big part of why "put nginx in front of it" is such a common, almost automatic step in production deployments. It's not tradition for tradition's sake. It's genuinely doing a lot of quiet, necessary work.
Where You've Actually Been Using Both, Already
Forward proxy, in disguise: if you've ever used a VPN to watch something unavailable in your region, or a company laptop that mysteriously can't reach certain sites, you've used a forward proxy. It stood between you and the internet, and the destination only ever saw it.
Reverse proxy, in disguise: if you've ever deployed a Next.js app behind nginx, put a Go backend behind Caddy, or used Cloudflare in front of any website, you've used a reverse proxy. Cloudflare, in fact, is really a giant reverse proxy network with CDN and security features bolted on. Same core idea from Part 1's CDN discussion, extended.
Where This Sits Next to Everything Else in This Series
Zooming out across the series so far:
CDN (Part 1): copies your content geographically closer to users, so requests travel less distance
Load balancer (Part 2): spreads requests across multiple servers, so no single machine drowns
Reverse proxy (this post): sits in front of your server(s), doing routing, SSL, caching, and yes often load balancing too
They're not competing tools. In a real production system, they typically all exist at once, layered on top of each other. A request might hit a CDN edge node first, which is really a reverse proxy, which might forward it to an origin server that itself sits behind another reverse proxy doing load balancing across several app instances.
It sounds like a lot of moving parts, and it is — but each one is solving one specific, understandable problem. Once you can name each layer, "the internet" stops being one big blur of magic and starts looking like a stack of individually sensible decisions.
What to Take Away
A proxy is a stand-in — the only real question is who it's standing in for.
Forward proxy = for the client, hiding the client from the destination.
Reverse proxy = for the server, hiding the server (and its internal structure) from the client.
nginx's job is much bigger than load balancing routing, SSL termination, caching, compression, and serving static files are all part of the same role.
Next time you write server_name in an nginx config, you'll know exactly whose interests that block of text is representing, and whose it's quietly hiding.
Top comments (0)