Home / Blog / Proxy 101 / Reverse vs Forward Proxy
What's the difference between reverse and forward proxies?
Proxy servers has become a common requirementin modern applications with distributed parts. For example, you’d have message brokers, event queues, serverless functions, virtual servers that require a single point of entry from a client.
In fact, consider this architectural diagram:
If you look at the diagram above, you’d see a proxy placed infront of the backend resources, leaving the client to interact with one point to get access to your app.
That’s exactly what a proxy is and does!
In fact, there’s two main types of proxies:
So, let’s aim to explore these two proxies with greater detail in this article and see where it’s best useful for.
A reverse proxy is a proxy server that sits between an application and a client. Consider this diagram:
The reverse proxy sits infront of your server resources. So, when you want to request a resource from a server, you communicate with the reverse proxy, which then sends the request to the relevant resource and returns the response back to you.
Simply put, a reverse proxy is a middleman between you and the websites you want to visit.Due to this nature, it is used in various aspects like:
It’s important to understand how a reverse proxy works. In fact, its workings can be summarized into these simple steps:
With this approach, it seems as if the reverse proxy is the origin of the content, not the backend server.
Due to the nature explained above, a reverse proxy offers two main benefits to its users:
However, a reverse proxy does carry some drawbacks:
On the other end of the spectrum, there’s the “forward proxy”, or simple known as a proxy server.
A forward proxy is an intermediary middleware between one or more user devices and the Internet. For example, consider the diagram:
As shown above, all requests go through the proxy before reaching the Internet. It acts on behalf of the client and routes the request to the destination. Next, it evaluates the response and forwards it back to the originating client.
These are used in situations like:
This can be summarized in these five steps:
It’s evident that forward proxies are highly beneficial. By using forward proxies, you can:
But, using a forward proxy does have its pitfalls.
Given everything that was discussed, you might be wondering—what should I use? Would I benefit more from a forward or a reverse proxy?
Well, it’s important to know that there isn’t a right or wrong answer here. It depends on your use case and how you intend to use it. But here are some guidelines that you can consider before making your decision.
Forward and reverse proxies are used in modern applications and organizations. They play a critical role in improving the overall performance and security of the context in which they are used.
However, the success of your implementation ultimately depends on the right proxy you’ve chosen. Therefore, evaluate your requirements first and then decide on the proxy you will use.
I hope you found this article helpful.
Thank you for reading.
9 min read
Ben Keane
14 min read
Jonathan Schmidt
10 min read
Aniket Bhattacharyea