View Single Post
Old 2nd August 2012, 21:10
MaddinXx MaddinXx is offline
Senior Member
Join Date: Jul 2011
Location: Switzerland
Posts: 200
Thanks: 26
Thanked 65 Times in 48 Posts
Default [Plugin] nginx reverse proxy for apache2

Hi HowToForge'ers

I have now been playing a longer time with nginx and the try, putting it in front of apache2 as a reverse proxy.

In general it is not that hard, but to get it play nicely together with ISPConfig isn't so easy.

I already had two "working" variants. One of them was with a universal default nginx server, doing a DNS lookup and choosing the proxy_pass server based on it - well, I just didn't like this and it had some problems.

Secondly, I tried with nginx "vhosts" per site etc. like ISPConfig does it for apache2, but I had problems with folder protection etc. since I was trying to serve static files directly through nginx.

What I want to do now, is presenting you my last try. It's not finished yet, but it already has some working code.

I also tried to create it on a "modular" base with PHP classes (I'm not a programmer anyway) so these parts can be reused within other plugins.

So for example we have the "vhost" class which does nothing other than handle everything related with vhost files.

There is something similar with the cert class, handling ssl...

Yep, it might be the best if you would just take a look. Contributions are very welcome!

You can follow/fork etc. the repository over at GitHub:

Please see 2nd post for changelog and more details!

Last edited by MaddinXx; 3rd August 2012 at 03:16.
Reply With Quote
Sponsored Links