Forward Proxy Vs Reverse Proxy
Hi everyone my name is Sandeep, I am a cloud ops engineer and Recently I have come across the concept of forward Proxy and Reverse Proxy. So let's find out together don’t forget to leave your thoughts at the end since it maters to me.
Let’s begin work understanding what is a forward proxy
I will explain everything with an example so you have a clear understanding since the definition you can go and search but this place is for real-life examples.
You are client and you want to access a website so you will go to your browser type in the website name and press enter and now you are connected to the website but this is not the usual case in some cases you get an error like 404 or you are not allowed to connect to this website or this website is banned. So what happens, in this case, it’s not like the website is not up and running. It is working perfectly fine but you are not able to connect to the website.
When this can happen this can happen if you are trying to access a website that is ban by your country and your ISP provider does not want you to connect to that website. So what the ISP does it will put one server which will look into the request which is made by you and it can filter the traffic so if the website like some political sites or some porn sites which are needed to be ban it will not allow you to connect to that websites.
So what you can do you can use a VPN service which will provide you a server and that server will redirect your request so in this case, your ISP will allow you to connect to the VPN server since this one is not banned and from there you can connect to any server or websites.
I think this is clear
Now let’s jump on Reverse Proxy.
Reverse proxy is used in case you want to hide the application server so in this case the client or you do not know to which server you are connecting to. So you made your request and from your ISP it will go to my application server and you get your websites but in case there is too much traffic then I will spin up one more machine and redirect your traffic to that server. This can be done by a reverse proxy server and it will hide the actual server details we are connecting to it will just show you the reverse proxy internally the reverse proxy server will be connecting you to one of the application servers. So what is the use of this server?
Reverse proxy server can be used for many applications but let's discuss the most common use it can be used for Load Balancing and caching.
How So Load Balancing works it will direct your traffic to one of the application server based on some algorithm like round-robin. So first request to the first server and second request to second server and third request to the first server and so on.
A reverse Proxy server can also help in caching, assume in all the application server there are some pages which are static and these pages are similar for all the clients so you will cache those static pages so that it will load faster
This blog is just an overview of what I understood I will also put some in detail article using reverse proxy server using Nginx.
Congrats if you made it to the end.