# Multiple vhosts

**URL:** <https://www.ruby-forum.com/t/multiple-vhosts/205317>\
**Category:** NGINX\
**Created:** [April 4, 2011, 1:48am UTC](https://www.ruby-forum.com/t/multiple-vhosts/205317 "2011-04-04T01:48:38Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![luislavena](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/0ea827/32.png) [@luislavena](https://www.ruby-forum.com/u/luislavena)\
**Post date:** [April 4, 2011, 1:48am UTC](https://www.ruby-forum.com/t/multiple-vhosts/205317/1 "2011-04-04T01:48:38Z")

</div>

I have tried to follow this [http://wiki.nginx.org/VirtualHostExample](http://wiki.nginx.org/VirtualHostExample) but  
it didn’t really worked for me.  
I want to have 2 domains on my nginx server  
one which will have root in c:www/x  
and one which will have root in C:/www/  
well I have been trying to make it work properly for hour but failed  
:\<so trying to get some help here

Posted at Nginx Forum:

> **[Multiple vhosts](https://forum.nginx.org/read.php?2,188059,188059#msg-188059)**
>
> I have tried to follow this http://wiki.nginx.org/VirtualHostExample but it didn't really worked for me. I want to have 2 domains on my nginx server one which will have root in c:www/x and one which will have root in C:/www/ well I have been trying...

---

<div class="post-metadata">

**Author:** ![Kraiser](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/43a26b/32.png) [@Kraiser](https://www.ruby-forum.com/u/Kraiser)\
**Post date:** [April 5, 2011, 9:35pm UTC](https://www.ruby-forum.com/t/multiple-vhosts/205317/2 "2011-04-05T21:35:08Z")

</div>

perhaps:

http {  
index index.html;

server {  
server\_name [www.domain1.com](http://www.domain1.com);  
access\_log logs/domain1.access.log main;

```
root /www/;

```

}

server {  
server\_name [www.domain2.com](http://www.domain2.com);  
access\_log logs/domain2.access.log main;

```
root /www/x;

```

}  
}

Posted at Nginx Forum:

> **[Re: Multiple vhosts](https://forum.nginx.org/read.php?2,188059,188587#msg-188587)**
>
> I have tried to follow this http://wiki.nginx.org/VirtualHostExample but it didn't really worked for me. I want to have 2 domains on my nginx server one which will have root in c:www/x and one which will have root in C:/www/ well I have been trying...
