apache + nginx

Hello :)

I know it's possible now to have either apache or nginx but I was wondering if at some point it will be possible to have both of them running at the same time (I don't really like cpanel but they do it really well).

Have a good day :)

Status: 
Active

Comments

Joe's picture
Submitted by Joe on Fri, 08/08/2014 - 00:23 Pro Licensee

What's the goal of having both running? (I'm not ruling it out, I just can't think of a good use case.)

Nginx is faster than apache for static files, so for all css, js, images (and more) nginx will take care of it, the rest will be for apache.

I have them both running on one of my systems. I have two IP addresses, one runs apache and the other runs nginx. I had to change a few things manually but it works for the most part.

Otherwise you will have to run one of them on a different port, if you have a single IP address.

Yeah I did that in the past, both running on different port (and I can still do it), but I was wondering if virtualmin would make this easy by configuring everything automatically :)

At the same time, no.

To get them on separate IPs I only had to do a little tweaking to make sure there were no port conflicts.

If you are having speed issues, you should take a look at CloudFlare, it is free!

Oh, I'm not having speed issues, I use my server more like a place to make experimentation :)

I have cloudflare, but unfortunately, it's kinda blocked in China (depends of the day), so I can't really use it.

I'd suggest to be careful here - while it has become fairly straightforward to set up nginx on a fresh system, it still involves quite a few manual steps - and at least so far, there's nothing in place to handle migrations between nginx<->apache vhosts as per: http://www.virtualmin.com/node/25176#comment-126690

In other words, nginx support -and especially apache interoperability- could still be considered to be relatively fragile - before people look at supporting more complex setups (such as e.g. reverse proxies, nginx for static content), it would be better to establish some well-defined interface for both HTTPDs and provide some kind of feature migration matrix to transparently convert compatible settings, but also recognize incompatible ones.

For the time being, it would already be a huge accomplishment to provide some kind of post-install wizard that allows to easily switch between apache and nginx while being aware of existing vhosts.