IndexModulesHandlers

Handler: HTTP reverse proxy

This handler is one of the most demanded features of Cherokee. It dispatches in-bound network traffic to a set of servers, and presents a single interface to the requesters. This is particularly useful to load balance a cluster of webservers at a much higher network stack level than the one allowed by a generic balancer.

All connections coming from the Internet addressed to one of the Web servers are routed through the proxy, which can either deal with the request or pass it (with or without modifications) to the other web servers.

The reverse proxy can do several interesting things besides simply load balancing. It can rewrite headers, and it can try to establish keep-alive connections with every system interfacing with it. That is, it doesn’t matter if all the clients requesting contents from our publicly available Reverse Proxy do not support this feature: the Keep-Alive connections can still be kept within the local pool, greatly improving performance.

Cherokee’s HTTP Reverse proxy is a powerful and modern implementation that also provides X-Sendfile and X-Accel-Redirect. These headers are automatically handled by the server and there is no need to manually specify anything for this functionality to work. Both X-Sendfile and X-Accel-Redirect work in the same way, so there are no artificial restrictions in place. The X-Sendfile/X-Accel-Redirect features work with any kind of object, not only static files, so dynamically generated contents are not a problem at all.

The task of the reverse proxy can be summarized in the following steps.

media/images/proxy_phase1.png
Phase 1
media/images/proxy_phase2.png
Phase 2

To use the HTTP reverse proxy handler you simply have to specify several parameters. First define a series of information sources. Those will be the ones handling the requests in the end.

Then you will have to specify the Reverse Proxy Settings by adjusting the following settings.

Handler

Request / Reply

These setting apply respectively to the HTTP request or response.

Back-end Servers

media/images/admin_handler_proxy.png
Reverse Proxy