Will there be a performance gain by using Apache’s mod_proxy to proxy off static file requests to Lighttpd/nginx

apache-2.2lighttpdmod-proxyreverse-proxy

I know there are lot of tutorials out there which suggest the use either nginx or lighttpd on port 80 and proxy dynamic requests to apache running on a different port. I am not ready to take that leap yet for my VPS. However I could definitely try the reverse scenario.

i.e. use apache's mod_proxy to proxy requests to nginx/lighttpd running on a different port.

But does that even make sense? will there be a performance gain if I use the reverse setup?

Best Answer

No. The performance on that is pretty much guaranteed to be significantly worse than just serving the static content out of Apache.

Furthermore, I don't think the performance gains to be had (if any) from serving static content from nginx outweigh the downsides of proxying dynamic requests back to Apache -- that is to say, the "conventional wisdom" embodied in the "lot of tutorials" is just plain wrong, stupid, and generally unnecessary (who would have thought it -- bad information on the Internet?). I'd be willing to wear the idea of using nginx to serve static assets from a separate assets domain, on a separate IP (even if it's on the same box), but I don't think proxying webserver to webserver makes sense.