# Nginx and virtual hosts

**URL:** <https://www.ruby-forum.com/t/nginx-and-virtual-hosts/130475>\
**Category:** Rails\
**Created:** [February 28, 2008, 4:08pm UTC](https://www.ruby-forum.com/t/nginx-and-virtual-hosts/130475 "2008-02-28T16:08:26Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![blinking\_bear](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/a9a28c/32.png) [@blinking\_bear](https://www.ruby-forum.com/u/blinking_bear)\
**Post date:** [February 28, 2008, 4:08pm UTC](https://www.ruby-forum.com/t/nginx-and-virtual-hosts/130475/1 "2008-02-28T16:08:26Z")

</div>

I need to move a site from a dedicated freebsd box running a bunch of  
sites  
under apache to a CentOS VPS. The VPS will run one rails site and  
possibly  
a few wordpress blogs. My question is this, how easy is it to have  
multiple  
virtual hosts configured under nginx? I’ve only ever done the 1 rails  
site  
per vps with nginx. I remember reading something about virtual hosts  
being  
difficult under nginx but I might have been smoking crack.

thanks

---

<div class="post-metadata">

**Author:** ![blinking\_bear](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/a9a28c/32.png) [@blinking\_bear](https://www.ruby-forum.com/u/blinking_bear)\
**Post date:** [February 28, 2008, 5:06pm UTC](https://www.ruby-forum.com/t/nginx-and-virtual-hosts/130475/2 "2008-02-28T17:06:28Z")

</div>

I found it really easy to set up multiple rails hosts but not tried  
with PHP I can’t see how it would be any harder.

my setup uses individual config files which are symlinked too. i used  
a tutorial fro slicehost along with one of their VPS slices and i’m  
very impressed with the service. They may even have a centOS and  
nginx specific tutorial.

[http://articles.slicehost.com/2008/1/16/ubuntu-gutsy-nginx-vhosts-](http://articles.slicehost.com/2008/1/16/ubuntu-gutsy-nginx-vhosts-)  
rails-and-mongrels

great staff, very friendly and helpful in the chat room.

cheers  
Nathan

I got it up and running having never configured a webserver.
