What is reverse proxy?

Asked

Viewed 1,037 times

28

When I was setting up the PHP FPM (PHP module that allows the use of Fastcgi), I stumbled on the term Reverse Proxy when I was researching some tutorials on how to set it up in Apache 2.

Example taken from this website, where is taught to install the module mod_proxy_fcgi:

ProxyPassMatch ^/(.*\.php(/.*)?)$ fcgi://127.0.0.1:9000/var/www/mysite/$1

But what would a Reverse Proxy be? I’ve heard that term before, but I don’t understand what it is.

4 answers

16

Quick response:

Reverse proxy would be a service or server forwarding requests to another service/server in a transparent way. The customer (browser for example) does not know the existence of this second service.

In your case the service httpd(apache) would be forwarded the processing of any request containing .php (is more or less what the regular expression ^/(.*\.php(/.*)?) or ) for the fcgi service:/127.0.0.1:9000 (local server port 9000).

This service in turn treats the request and response using apache as a "proxy" for the client -- REVERSE PROXY.

Another possible origin of the name is that usually the proxy is used on the client side, so the "reverse" gives the idea that it is on the other side, different from the "normal".

11


To explain what a Reverse Proxy is, I think it is important to also explain how it differs from Proxy.

The Reverse Proxy (Reverse Proxy) is a proxy that we can say acts on the server side, different from the Proxy (Forward Proxy) acting on the client’s side.

The Proxy is concerned with hiding the identities of the machines behind it, providing mechanisms such as cache, authentication, restricting access to some websites, etc. Thus, when some computer within a network makes a request to the Internet through the Proxy, the Proxy will be in charge of making the request, waiting for the reply and forwarding it to the computer that requested it.

Already the Reverse Proxy does the same, but for the servers. When the request arrives, the Reverse Proxy obtains that information and transfers it to one of the available servers, being able be able to make Load Balance. It can also compress data, cache frequently requested content, protect server identities, allow them to be accessed under a single URL, etc.

See a image illustrating both:

inserir a descrição da imagem aqui

In their essence, both are much similar, having the same characteristics.

I can’t tell if this applies to all cases, but in fact the same proxy can be forward and re-verse at the same time, taking into account different populations. That is, different is just the role that the proxy will play as needed: serve clients or servers.

5

First it is interesting to understand the concept of Proxy.
The Proxy is a layer (middleware, server, any implementation that creates that layer) between two points.
This is a broader concept, can be applied in programs and other things. For the concept of the question, a Proxy is intermediating two connected devices on the Internet, which can be two computers, device (printer, gadget, etc.), etc.

What is the reason for using this intermediary between connections? The reasons are several:

  • protect devices and their identities;
  • protect the network they are part of;
  • restrict/block improper access, etc;

Then a Proxy Forward (forwarding) or simply Proxy, is a middleware, which may be software or hardware that is in front of the connection of one computer or device to another.
The figure below, taken from Cloudfire, demonstrates this: inserir a descrição da imagem aqui

Note that, several computers in a network has in front of you a Proxy, And that’s the middle between them and an Internet resource, a server for example. The reasons can be diverse, as mentioned above, how to protect the identity of the source computer, or even filter what can "exit" to the internet, blocking access to adult websites or upload files for example. So let’s imagine the Proxy as

The layer that is in front of the source computer and the destination that this want to access.

This other image shows the diagram of a Reverse Proxy:
inserir a descrição da imagem aqui

Note that it is basically the same, the purposes may also be, but in this case the Proxy is in front of the destination resource, i.e.,

The layer that is in front of the target computer, and the source that needs to access it.

Hence the concept of "inverse", one is just after the origin, the other before destiny, in a very simple way is what it means.

1

A reverse proxy is a network server usually installed to stand in front of a web server. All externally originated connections are addressed to one of the Web servers through a routing done by the proxy server, which can handle the request itself or forward the request in whole or in part to a Web server, which will handle it One of the greatest features of reverse proxy is its security that makes it harder to penetrate the server, SSL encryption

I hope I’ve cleared your doubts

Browser other questions tagged

You are not signed in. Login or sign up in order to post.