I have been using an Apache setup to proxy to two different Rails apps for two different domain names mapped to the same ip address, ie. www.web1.com goes to app1 and www.web2.com goes to app2. The Apache config is roughly as follows, and the mongrels are started with the prefix option ie. /app1 on 5000 and /app2 on 6000
<VirtualHost *:80> ServerName www.web1.com DocumentRoot "${path}/www/web1"
ProxyPass /images http://127.0.0.1:5000/app1/images ProxyPass /app1 http://localhost:5000/app1 ProxyPassReverse /app1 http://localhost:5000/app1 </VirtualHost>
<VirtualHost *:80> ServerName www.web2.com DocumentRoot "${path}/www/web2"
ProxyPass /images http://127.0.0.1:6000/app2/images ProxyPass /app2 http://localhost:6000/app2 ProxyPassReverse /app2 http://localhost:6000/app2 </VirtualHost>
My question is that I want to give haproxy a try and wondered if I could do this sort of thing with haproxy itself or whether I still require apache?
People have mentioned nginx but after struggling with Apache httpd.conf for a while I am loath to go back to square one! Is nginx easier or harder to do this sort of stuff than Apache?
Cheers Giorgio