Support for Nginx as a caching reverse proxy to Apache?

Hi, I have seen this topic discussed in the past but haven’t seen anything recent. Is this something that will ever be supported? Thanks :slight_smile:

Nothing has changed. It’s not generally useful, so there is no intention to support it. I know some control panels support such a thing, but there is simply no benefit to it.

If you want nginx, use nginx. We support ngnix. If you want Apache, use Apache. We support Apache. If you want both, you’re wanting to make a mess for no good reason.

1 Like

I agree with Joe. In a shared hosting environment and particularly with the small and medium size systems and traffic that the lay Virtualmin user manage with it, the performance benefits of Nginx → Apache are debatable.

The only use case which I can think of that justifies using Nginx as a caching reverse proxy to Apache is a SaaS environment which one may want to orchestrate and automate using the existing API that Virtualmin offers. Virtualmin is already 99% SaaS orchestration ready due to its API - the only missing piece of the puzzle is Virtualmin’s support for Nginx as a caching reverse proxy to Apache. If this additional feature were in place, it would be super-easy to use the Virtualmin API alone to create a SaaS environment where domains and sub-domains can be created, each as a server or sub-server in Virtualmin, each with its own certificate (either a free stand-alone certificate from Let’s Encrypt or shared across subdomains from a common wildcard certificate - amazingly Virtualmin GPL supports this very, very useful feature for SaaS) and with each client being given granular access to his own account and resources via Usermin. Wow - such solutions cost $$$ and Virtualmin can be used in its GPL form for all this, out of the box.

So it’s not just for the debatable additional performance that Nginx → Apache might offer but to evolve Virtualmin to address an emergent requirement that the Virtualmin Gods should consider enabling support for Nginx as a caching reverse proxy to Apache. One could argue, however, that a separate world-facing Virtualmin server running Nginx could be used to service separate Virtualmin servers running Apache and one could also argue that Apache itself has modules which offer proxying and other features available only in the paid version of Nginx and these are all valid arguments.

But a future version of Virtualmin which offers everything that a SaaS startup needs, running out of a single low cost box to begin with, could be a boon for many.

nginx on a separate server as a load balancer (optionally caching) is an entirely separate use case, and a reasonable one. But there is no performance benefit to nginx+Apache over just using nginx appropriately by itself (and for the vast majority of users, Apache is also sufficient…the performance difference between nginx and Apache in most users workloads is lost in the noise compared to the performance of the app and database).

But, a separate server as a load balancer is not a Virtualmin question. Cloudmin might get that kind of feature, though.

1 Like

I’ve seen very loaded servers have Nginx installed as a reverse caching proxy and it lessens the load considerably. This is the kind of configuration I’m referring to. As for the reason for doing this, there are quite a number of CMSs that work far better with Apache .htaccess than with Nginx’s configuration, with the most outstanding example being WordPress. So, that’s my motivation. I can likely configure it by putting Apache on another port and then setting up Nginx outside of Virtualmin- but I do wish it was supported directly.

You don’t need nginx to add web server caching. Apache has caching features, too. Adding another webserver just adds…another web server. If caching of static assets (or assets that get reasonable cache-control headers…I don’t know that WordPress content meets this criteria) will help your performance, then enabling caching in Apache will help your performance.

1 Like

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.