# Haproxy

**URL:** <https://www.ruby-forum.com/t/haproxy/119574>\
**Category:** Rails\
**Created:** [November 8, 2007, 4:26am UTC](https://www.ruby-forum.com/t/haproxy/119574 "2007-11-08T04:26:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![giorgio](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/cab0a1/32.png) [@giorgio](https://www.ruby-forum.com/u/giorgio)\
**Post date:** [November 8, 2007, 4:26am UTC](https://www.ruby-forum.com/t/haproxy/119574/1 "2007-11-08T04:26:46Z")

</div>

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](http://www.web1.com) goes to app1 and [www.web2.com](http://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](http://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 \*:80\>  
ServerName [www.web2.com](http://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

```

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

---

<div class="post-metadata">

**Author:** ![giorgio](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/cab0a1/32.png) [@giorgio](https://www.ruby-forum.com/u/giorgio)\
**Post date:** [November 8, 2007, 1:21pm UTC](https://www.ruby-forum.com/t/haproxy/119574/2 "2007-11-08T13:21:32Z")

</div>

Hello,

I’m also deciding between Apache and nginx. Have you come across this  
post:  
[http://blog.jordanisip.com/2007/6/27/rimuhosting-vps-nginx-mongrel-clusters-multiple-domains-a-happy-jordan](http://blog.jordanisip.com/2007/6/27/rimuhosting-vps-nginx-mongrel-clusters-multiple-domains-a-happy-jordan)  
The author switched to nginx after struggling with Apache. I haven’t  
done it myself but you might find it useful.

- Anthony
