# Nginx Vhost

**URL:** <https://www.ruby-forum.com/t/nginx-vhost/215937>\
**Category:** NGINX\
**Created:** [January 20, 2012, 1:56am UTC](https://www.ruby-forum.com/t/nginx-vhost/215937 "2012-01-20T01:56:33Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dubstep](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/cdc98d/32.png) [@dubstep](https://www.ruby-forum.com/u/dubstep)\
**Post date:** [January 20, 2012, 1:56am UTC](https://www.ruby-forum.com/t/nginx-vhost/215937/1 "2012-01-20T01:56:33Z")

</div>

Hello,

i have installed Nginx 1.0.11 on FreeBSD 9. I have configured a Catch  
All  
Host and my Domain. But my Domain Nginx want not accept. He give only  
the Catch All Domain back.

user www; worker\_processes 1; error\_log logs/error.log;

events {  
worker\_connections 1024;  
}

http {  
include mime.types;  
default\_type application/octet-stream;

log\_format main '$remote\_addr - $remote\_user [$time\_local] “$request”  
’  
'$status $body\_bytes\_sent “$http\_referer” ’  
‘“$http\_user\_agent” “$http\_x\_forwarded\_for”’;

access\_log /var/log/www/access.log main;

sendfile on;  
keepalive\_timeout 65;

server {  
listen 80;  
server\_name \_;  
access\_log logs/access.log main;

location / {  
root /usr/local/www/nginx;  
index index.html index.htm;  
}

error\_page 404 /404.html;  
error\_page 500 502 503 504 /50x.html;  
location = /50x.html {  
root /usr/local/www/nginx-dist;  
}  
}

#[silviosiefke.de](http://silviosiefke.de)  
server {  
listen 80;  
server\_name [silviosiefke.de](http://silviosiefke.de);  
access\_log /usr/local/www/vhost/silviosiefke\_de/log/access.log main;  
error\_log /usr/local/www/vhost/silviosiefke\_de/log/error.log;

location / {  
root /usr/local/www/vhost/silviosiefke\_de/html;  
index index.html index.htm index.php;  
}

error\_page 500 502 503 504 /50x.html;

location = /50x.html {  
root /usr/local/www/nginx-dist;  
}

#location /article-(\d+).html$ {  
#try\_files $uri $uri/ /blogdetail.html?id=$1;  
#}

# pass the PHP scripts to FastCGI

#location ~ .(php|htm|html)$ {  
#fastcgi\_pass 127.0.0.1:9000;  
#fastcgi\_index index.php;  
#fastcgi\_param SCRIPT\_FILENAME  
/usr/local/www/vhost/silviosiefke\_de/html  
$fastcgi\_script\_name;  
#include /usr/local/etc/nginx/fastcgi\_params; #}

#location ~ /.ht {  
#deny all;  
#}  
}  
}

When i give the ip nginx use root /usr/local/www/nginx and when i call  
[silviosiefke.de](http://silviosiefke.de), nginx give back the root /usr/local/www/nginx.

Where is the mistake? Thanks for help.

Regards  
Silvio
