长治网站建设
nignx+php 虚拟目录配置支持PHP

nignx+php 虚拟目录配置支持PHP,本人实际测试通过,没有问题。

 

 

server {
        listen       80;
        server_name  xxx.com www.xxx.com;
 index index.html index.htm index.php;
 root /alidata/www/xxx/;

 
 

 location ~ /xxx/.+.php$ {
            root /alidata/www/;
            rewrite /xxx/(.*.php) / 栏目内容 break;
            fastcgi_pass  127.0.0.1:9000;
     fastcgi_index index.php;
     include fastcgi_params;
     fastcgi_param SCRIPT_FILENAME /alidata/www/xxx/$fastcgi_script_name;
 }
 location ~ ^/xxx(.*)$ {
   alias /alidata/www/xxx/ 栏目内容 ; 
   index index.php index.html index.htm;
 }
 

 location ~ .*.(php|php5)?$
 {
  #fastcgi_pass  unix:/tmp/php-cgi.sock;
  fastcgi_pass  127.0.0.1:9000;
  fastcgi_index index.php;
  include fastcgi.conf;  
 }
 location ~ .*.(gif|jpg|jpeg|png|bmp|swf)$
 {
  expires 30d;
 }
 location ~ .*.(js|css)?$
 {
  expires 1h;
 }
       
 #伪静态规则
 #include /alidata/server/nginx/conf/rewrite/phpwind.conf;
 #access_log  /alidata/log/nginx/access/phpwind.log;
}

2006-2014 IT0355.com 山西中联科创科技有限公司. All Rights Reserved.
电话:0355-3728808 传真:0355-3728808
ICP备案号:晋ICP备06003721号本站已通过国际W3C认证
关键字:中联科创,长治网站建设,长治网站推广,长治网络工程,长治软件开发,山西网站建设,山西软件开发 长治五金网