![]() |
[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: https://github.com/Rackster/ispconfi...-reverse-proxy Note Please see 2nd post for changelog and more details! |
Changelog
20120803 The plugin is now nearly stable, everything expect Redirects is working 20120802 Presentation and initial repository What's working
What's not working
|
edit functions seems to close after a while
20120806
Renamed GitHub repo, new location at: https://github.com/Rackster/ispconfi...-reverse-proxy added vhost backup |
Does this still work "as is" in Debian squeeze and ispconfig 3.0.4.6 following instructions in https://github.com/Rackster/ispconfi.../Installation?
I can't find the following: so we can modify the copy (which is much more safer): nano /usr/local/ispconfig/server/conf-custom/vhost.conf.master and replace the correct parts (you'll find them) with: <tmpl_if name='ssl_enabled'> <VirtualHost {tmpl_var name='ip_address'}:445> <tmpl_else> <VirtualHost {tmpl_var name='ip_address'}:82> </tmpl_if> Thank you! |
Hi Davide
The plugin still works as of version 3.0.4.6. the file itself (/usr/local/ispconfig/server/conf-custom/vhost.conf.master) gets copied a step above, e.g. you copy the file from ../conf to conf-custom. Afterwards the part you have to replace with the one provided looks something like: <VirtualHost {tmpl_var name='ip_address'}:{tmpl_var name="port"}> |
I've been searching for two "port" to replace, evidently with no success.
So have I to replace that only one line with the code you provides? Thank you! |
Hi
Yes, the code you have to replace is on line 9: Code:
<VirtualHost {tmpl_var name='ip_address'}:{tmpl_var name='port'}> |
| All times are GMT +2. The time now is 06:12. |
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.