# I have a issue with virtual host

**URL:** <https://www.ruby-forum.com/t/i-have-a-issue-with-virtual-host/224352>\
**Category:** NGINX\
**Created:** [November 8, 2012, 2:38pm UTC](https://www.ruby-forum.com/t/i-have-a-issue-with-virtual-host/224352 "2012-11-08T14:38:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![aris](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/258eb7/32.png) [@aris](https://www.ruby-forum.com/u/aris)\
**Post date:** [November 8, 2012, 2:38pm UTC](https://www.ruby-forum.com/t/i-have-a-issue-with-virtual-host/224352/1 "2012-11-08T14:38:33Z")

</div>

hy everybody  
I try to create a virtual host (server block) on nginx, and i have two  
issue.

When i m going to\* [http://localhost](http://localhost)\* ,i see my website  
But when i try to go to the virtual host (server block) \*  
[http://localhost/websvn](http://localhost/websvn)\*  
I get an error because he try to find a webpage with the name _websvn_  
on  
my first website.  
I don’t understand why ??

_/conf/nginx.conf_

http {

> ```
> default_type application/octet-stream;
> proxy_cache_path /mnt/donner/nginx/cache levels=1:2 keys_zone=one:10m;
> listen 80;
> #server_name localhost;
> passenger_enabled on;
> passenger_use_global_queue on;
> 
> error_log /home/logs/nginx/error.log;
> access_log /home/logs/nginx/access-global.log;
> 
> ```

```
  }

```

}

> 

_/vhost-enable/srv-websvn.conf_

server {

```
        listen 80;
        server_name srv-websvn;
       # rewrite ^/(.*) http://localhost/$1 permanent;

        error_log /home/logs/websvn/error.log;
        access_log /home/logs/websvn/access.log;
       }

```

server {

```
        listen 80;
        server_name srv-websvn;

        error_log /home/logs/websvn/error.log;
        access_log /home/logs/websvn/access.log;

```

location / {

```
              root /home/sites_web/websvn/;
              index index.html;
              #try_files $uri $uri/ /index.html;

         }
       }

```

---

<div class="post-metadata">

**Author:** ![grunk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/9dc877/32.png) [@grunk](https://www.ruby-forum.com/u/grunk)\
**Post date:** [November 8, 2012, 4:59pm UTC](https://www.ruby-forum.com/t/i-have-a-issue-with-virtual-host/224352/2 "2012-11-08T16:59:58Z")

</div>

On Thu, Nov 8, 2012 at 8:37 PM, Olivier M. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> hy everybody  
> I try to create a virtual host (server block) on nginx, and i have two issue.
> 
> When i m going to [http://localhost](http://localhost) ,i see my website  
> But when i try to go to the virtual host (server block) [http://localhost/websvn](http://localhost/websvn)  
> I get an error because he try to find a webpage with the name websvn on my  
> first website.  
> I don’t understand why ??

I think you’re confused between virtualhost and subdirectory.
