- 积分
- 2
- 威望
-
- 金钱
-
- 注册时间
- 2013-11-12
- 在线时间
- 小时
- 最后登录
- 1970-1-1
|
新装了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.log access;
- }
- include vhost/*.conf;
- }
复制代码
vhost目录下已经有两个虚拟主机文件
- [root@localhost conf]# cd vhost/
- [root@localhost 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已重启过了
- [root@localhost vhost]# 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_pass unix:/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;
- }
复制代码 |
|