绑定多个虚拟主机不成功,虚拟主机只能访问默认目录
新装了lnmp1.2,各项设置也完成了,可只有1个虚拟主机能绑定到对应的目录,其他的都到默认目录去了,还请知道的给指点下为什么,谢谢.cat nginx.conf内容如下:
server
{
listen 80 default_server;
#listen [::]:80 default_server ipv6only=on;
server_name baisogo.com www.baisogo.com;
index index.html index.htm index.php;
root/home/wwwroot/default;//绑定的虚拟主机却访问到了此目录
#error_page 404 /404.html;
include enable-php.conf;
location /nginx_status
{
stub_status on;
access_log off;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
}
location ~ .*\.(js|css)?$
{
expires 12h;
}
location ~ /\.
{
deny all;
}
access_log/home/wwwlogs/access.logaccess;
}
include vhost/*.conf;
}
vhost目录下已经有两个虚拟主机文件
# cd vhost/
# ll
total 8
-rw-r--r--. 1 root root 824 Jun 19 13:28 sobaigu.com.conf
-rw-r--r--. 1 root root 821 Jun 19 12:26 wubase.com.conf
其中,sobaigu.com可以正常访问,但wubase.com却访问到了默认的default目录,nginx已重启过了
# cat wubase.com.conf
server
{
listen 80;
#listen [::]:80;
server_name wubase.com *.wubase.com;
index index.html index.htm index.php default.html default.htm default.php;
root/home/wwwroot/wubase.com;
include wordpress.conf;
#error_page 404 /404.html;
location ~ [^/]\.php(/|$)
{
# comment try_files $uri =404; to enable pathinfo
try_files $uri =404;
fastcgi_passunix:/tmp/php-cgi.sock;
fastcgi_index index.php;
include fastcgi.conf;
#include pathinfo.conf;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
}
location ~ .*\.(js|css)?$
{
expires 12h;
}
access_log off;
}
/usr/local/nginx/sbin/nginx -t 进行测试配置文件 原帖由 licess 于 2015-6-19 15:17 发表 https://bbs.vpser.net/images/common/back.gif
/usr/local/nginx/sbin/nginx -t 进行测试配置文件
谢谢军哥解答.
# /usr/local/nginx/sbin/nginx -t
nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful
重装了下nginx,好了,神奇的问题,不知道为什么
页:
[1]