What is the difference between a proxy server and a reverse proxy server?
What is the difference between a proxy server and a reverse proxy server?
The previous answers were accurate, but perhaps too terse. I will try to add some examples.
First of all, the word "proxy" describes someone or something acting on behalf of someone else.
In the computer realm, we are talking about one server acting on the behalf of another computer.
For the purposes of accessibility, I will limit my discussion to web proxies - however, the idea of a proxy is not limited to websites.
Most discussion of web proxies refers to the type of proxy known as a "forward proxy."
The proxy event, in this case, is that the "forward proxy" retrieves data from another web site on behalf of the original requestee.
For an example, I will list three computers connected to the internet.
Normally, one would connect directly from X --> Z.
However, in some scenarios, it is better for Y --> Z on behalf of X,
which chains as follows: X --> Y --> Z.
Here is a (very) partial list of uses of a forward proxy server:
1) X is unable to access Z directly because
a) Someone with administrative authority over X's internet connection has decided to block all access to site Z.
Examples:
The Storm Worm virus is spreading by tricking people into visiting familypostcards2008.com, so the system administrator has blocked access to the site to prevent users from inadvertently infecting themselves.
Employees at a large company have been wasting too much time on facebook.com, so management wants access blocked during business hours.
A local elementary school disallows internet access to the playboy.com website.
A government is unable to control the publishing of news, so it controls access to news instead, by blocking sites such as wikipedia.org. See TOR or FreeNet.
b) The administrator of Z has blocked X.
Examples:
The administrator of Z has noticed hacking attempts coming from X, so the administrator has decided to block X's IP address (and/or netrange).
Z is a forum website. X is spamming the forum. Z blocks X.
For this example, I will list three computers connected to the internet.
Normally, one would connect directly from X --> Z.
However, in some scenarios, it is better for the administrator of Z to restrict or disallow direct access and force visitors to go through Y first.
So, as before, we have data being retrieved by Y --> Z on behalf of X, which chains as follows: X --> Y --> Z.
What is different this time compared to a "forward proxy," is that this time the user X does not know he is accessing Z, because the user X only sees he is communicating with Y.
The server Z is invisible to clients and only the reverse proxy Y is visible externally. A reverse proxy requires no (proxy) configuration on the client side.
The client X thinks he is only communicating with Y (X --> Y), but the reality is that Y forwarding all communication (X --> Y --> Z again).
In the above scenarios, Z has the ability to choose Y.
The difference is primarily in deployment. Web forward and reverse proxies all have the same underlying features. They accept requests for HTTP requests in various formats and provide a response, usually by accessing the origin or contact server.
Fully featured servers usually have access control, caching, and some link-mapping features.
A forward proxy is a proxy that is accessed by configuring the client machine. The client needs protocol support for proxy features (redirection, proxy authentication, etc.). The proxy is transparent to the user experience, but not to the application.
A reverse proxy is a proxy that is deployed as a web server and behaves like a web server, with the exception that instead of locally composing the content from programs and disk, it forwards the request to an origin server. From the client perspective it is a web server, so the user experience is completely transparent.
In fact, a single proxy instance can run as a forward and reverse proxy at the same time for different client populations.
A proxy server proxies (and optionally caches) outgoing network requests to various not-necessarily-related public resources across the Internet. A reverse proxy captures (and optionally caches) incoming requests from the Internet and distributes them to various internal private resources, usually for high availability purposes.
Proxy (Forward Proxy):
When computers on your LAN connect to a proxy server that accesses the Internet. Benefits include only the server being exposed to the Internet. People on the outside are unable to access the computers directly. Forward proxies can improve Internet access for users by caching downloads. They can also be used to restrict access to certain sites. Also, only the proxy server would need a public address, not the clients connecting to it.
Reverse Proxy:
A reverse proxy is the opposite of a forward proxy. Instead it acts as a proxy on behalf of the servers being connected to. Instead of accessing a remote server directly, a user would go through the reverse proxy and get directed to the appropriate server from there. Only the reverse proxy would need an SSL certificate, only one public IP address would be needed, and it can handle load balancing of incoming requests to enhance the overall user experience.
Image Source: Creating a Forward Proxy Using Application Request Routing
Cloudflare has a great article with images explaining this in details.
Check here: What Is A Reverse Proxy? | Proxy Servers Explained
My understanding from an Apache perspective is that proxy means that if site x proxies for site y, then requests for x return y.
The reverse proxy means that the response from y is adjusted so that all references to y become x.
So that the user cannot tell that a proxy is involved...
Here's an example of a reverse proxy (as a load balancer).
A client surfs to website.com and the server it hits has a reverse proxy running on it. The reverse proxy happens to be Pound. Pound takes the request and sends it to one of the three application servers sitting behind it. In this example, Pound is a load balancer. That is, it is balancing the load between three application servers.
The application servers serve up the website content back to the client.
A forward proxy serves users: it helps users access the server.
A reverse proxy serves the server: it protects the server from users.
Difference between Proxy server (also called forward proxy) and Reverse Proxy Server depends on the point of reference.
Technically, both are exactly the same. Both serve the same purpose of transmitting data to a destination on behalf of a source.
The difference lies in 'on whose behalf is the proxy server acting / who is the proxy server representing?'
If the proxy server is forwarding requests to internet server on behalf of the end users (Example: students in a college accessing internet through college proxy server.), then the proxy is called 'Forward proxy' or simply 'Proxy'.
If the proxy server is responding to incoming requests, on behalf of a server, then the proxy is called 'Reverse Proxy', as it is working in the reverse direction, from the point of view of the end user.
Some Examples of Reverse proxies:
Use of forward proxy:
Use of Reverse proxy:
Looking from the perspective of the user: when sending a request to a proxy or reverse proxy server:
proxy - requires two arguments:
1) what to get and 2) which proxy server to use an intermediate
reverse proxy - requires one argument:
1) what to get
A reverse proxy fetches contents from another server unbeknownst to the user and returns the result as if it originated from the reverse proxy server.
Most of the previous answers are good, but in my opinion none comes very close to addressing well enough the "reverse" quality that differentiates the two. To do that, some way of visualizing the "reverse" nature of what is essentially the same thing (a proxy) needs to be given, and it needs to be given in a well abstracted way.
A proxy (implicitly "forward proxy") connects multiple local clients to any one remote server:
c--
|--p--s
c--
A reverse proxy connects multiple local servers to any one remote client (notice how the layout reverses):
s--
|--p--c
s--
It is a matter of perspective really and properly understanding the concept requires abstracting away non-essential (to the particular concept) details though they may be very important when it comes to the pragmatics of proxy operation. Such details include the fact that in both scenarios the reality is that multiple clients connect to multiple servers, that clients and servers may not really be local or remote, where the Internet cloud is located or what kind of visibility exists between client and server.
Let's consider the purpose of the service.
In forward proxy:
Proxy helps user to access server.
In reverse proxy:
Proxy helps server to be accessed by user.
In the latter case, the one who is helped by the proxy is no longer a user, but a server, that's the reason why we call it a reverse proxy.