Skip to content

What is reverse proxy?

Alexander Andreev edited this page Jun 1, 2017 · 3 revisions

Reverse proxy is a type of proxy server, that retrieves data from a client, pass it to a backend (for example, Apache), read response and sends it back to client.

How can I use it?

That technique can be useful in many situations. For example, if backend is synchronous i.e. can't work while not retrieved information from socket, it is possible to perform DoS attack: connect many slow clients so that "fast" clients will be waiting for end of slow connections. Charon is asynchronous, so slow clients will not affect average response time, but when whole HTTP request is accumulated on server, Charon will upstream request to backend. Cause usually reverse proxies and backend is connected using LAN, request will be recieved on backend very quickly. Also, reverse proxies are often used in web projects as a load balancer: if you have many backend, you need to spread clients over them. And the last commonly used optimization is serving rarely modified static files — CSS, JavaScript and etc. You don't need a backend server to pass them to clients. They can be slower, that proxies, cause they are often written in high-level language. Instead, this work can be entrusted to reverse proxies.

Is there alternatives?

Charon is not only one http server and reverse proxy in the world. At least there is:

  • apache — the most popular http server
  • nginx — very popular reverse proxy and http server, often used in big companies as load balancer and static files server
  • Varnish — popular caching server and reverse proxy, commonly used to cache whole HTTP response in order to don't hit backend
  • Squid — popular caching server and forward proxy
Clone this wiki locally