Introduction
A reverse proxy is a server that sits between clients (browsers) who request web pages, and web servers that serve requested web pages.
Reverse proxies are typically used to help increase security, performance, and reliability.
Reverse proxies can perform many functions, often in combination with other software or hardware, such as:
- load balancer: distributing incoming requests over several web servers
- cache: storing served content
- application firewall: protecting against certain types of web-based attacks
- compression: optimizing and compressing content so it reaches the browser faster
Depending on the set of features reverse proxies offer, they are also called web accelerators or HTTP accelerators.
If a reverse proxy caches content sent by a web server, that web server is also referred to as origin server.
Reverse proxies can be part of your own hosting environment, or you may use an external service like Cloudflare which offers free and paid subscriptions depending on your needs.
Drupal configuration
There are Drupal modules that help support several of the most used reverse proxy servers.
Regardless of your choice of proxy server and its module options, the Browser and proxy cache maximum age setting at Manage > Configuration > Development > Performance instructs the reverse proxy how long it is allowed to cache each piece of content:
Opensource reverse proxy servers
Apache, Nginx, and Caddy, the most common web servers, all have reverse proxy capabilities.
In certain scenarios where High Availability is required and Apache/Nginx/Caddy don't suffice, dedicated reverse proxy servers can be useful.
The following opensource reverse proxy servers are often used in Drupal High Availability environments:
Advantages
Reverse proxies can act as a content cache, but can also perform a variety of other tasks. When used as a content cache, they can significantly increase performance and reduce the load on your web- and database server(s).
Disadvantages
As with all caching solutions, cached data becomes outdated and needs to be refreshed. In other words, the reverse proxy's cache entries need to be invalidated when they have become stale.
However you have set up caching inside and around Drupal - possibly using core and contributed cache modules and/or in-memory data stores such as Redis - you need to test and make sure that they are all caches in your chain of caches are properly cleared.
The more caches you add to your infrastructure, the more complicated it may become to troubleshoot misbehaving caches.
Summary
- Reverse proxies sit between clients and web servers, and can act as:
- load balancer
- content cache
- application firewall
- A reverse proxy can be part of your infrastructure, or may be an external solution managed by a third party.
- Reverse proxies can offer a significant performance increase, but can also be complex to manage, and complex to coordinate with other cache mechanisms.