What is a Proxy?
We have talked so much about what proxies are in the past, that I’m considering to just write a full post about it to use for reference in the future. I also very much recommend reading Adams’ article on how to stay anonymous on the web. But for now – a proxy, or in this case I might call it a forward proxy – is a middleman between you and the internet. When you want to access a website and you are using a proxy, your request travels to the proxy server and from there to the target.
Each proxy server has its own IP and handles your request on your behalf, this way giving you extra security by hiding your IP address. Forward proxies act on request of a client. I also really enjoyed this post on what a proxy is that covers all the basics and I recommend giving it a read.
And if you ended up here while looking for information on what a forward proxy is, I also invite you to check out our 2019 proxy provider market research, which is the most comprehensive up-to-date overview of proxy providers (and it’s completely free).
What is a Reverse Proxy?
Reverse proxy acts on a request of an online service provider, so it’s the opposite from forward proxies who get the request directly from the user. This is the simple way of explaining it. In this case, it is the reverse proxy server that the user sees as their final destination.
As you can see in my handy dandy scheme – a reverse proxy is located in a different position than a forward one. What does it mean, you might ask? Seems pretty similar to a forward proxy, doesn’t it? Well, again, in the case of reverse proxies, instead of a client hiding their IP from you, you as a service provider are hiding your backend server from the client.
Imagine a situation in which a client is using a forward proxy server (the type we usually have in mind when we talk about proxies) and the online service provider uses a reverse proxy server. What we get here as a result is an exchange in which two sides are hidden from one another, two proxy servers just had a conversation.
Hiding backend servers isn’t the only reason to use reverse proxies. Here’s a list of other use cases I gathered while doing my usual scavenger hunt through the web:
- Security – your backend server’s information isn’t visible to your user, which increases the level of security significantly. Users who might want to exploit any vulnerable points you might have in your infrastructure wouldn’t be able to do so. Most reverse proxies even have features that help keep backend servers secure from DDoS attacks by limiting the number of connections made from one IP or by blacklisting (rejecting) IPs.
- Web acceleration – a reverse proxy can be used to compress server responses prior to their return to a client this way reducing the amount of bandwidth required. It can also be used for caching, when the reverse proxy stores a copy of the backends server’s response and if the user makes the same request again, the reverse proxy provides an already saved response. SSL (TLS) encryption and decryption can also be done by a reverse proxy and that frees up a backend server’s resources. These are all great techniques to reduce load times.
- Load balancing – this is a big one, I’d say. Reverse proxy servers can also offer a load balancing solution for all the big websites – they can distribute all incoming traffic between multiple servers. This method prevents overloading the site or one of the servers by distributing request handling evenly. So even if one server fails to do its job, others are there to help.
- Global Server Load balancing – in this case, reverse proxies are doing the same job as with just plain load balancing, but now with locations! A reverse proxy can distribute requests from users to servers closest to them. For example, if a person from Warsaw is connecting to your website located in San Francisco, he might as well be redirected to a server somewhere in Poland. This kind of load balancing shortens load times by decreasing the physical distance a request has to travel. Helpful!
Is Reverse Proxy a Load Balancer?
Yes. And also no. From what I found during my research, a reverse proxy could and should be used even if you have only a single server. It provides security and can also act as the public face of your site (your backend server wouldn’t be visible to users). Using it as a load balancer only makes sense if you have multiple servers. But then again, if you have multiple servers, reverse proxy can distribute the traffic between them.
Essentially, a reverse proxy will do load balancing and most load balancers will also act as a reverse proxy (except things like a DNS-only load balancer). If you’d like to learn more about the differences between these two concepts, you could also invest some time into reading this too.
A reverse proxy is usually used by sysadmins to solve server overload problems by using the load balancing method and thus making the site reliably available to users. Load balancing helps distribute traffic between multiple servers, reducing the load for any single server.
A reverse proxy can also act as a technical “public face” of the website – an additional layer between the user and the backend infrastructure, providing all kinds of benefits.
And in very simple terms by Nginx, “a reverse proxy accepts a request from a client, forwards it to a server that can fulfill it, and returns the server’s response to the client (which means a server behind the reverse proxy can communicate with somewhat different features of a protocol or a different protocol).”