开发测试

Nginx伪静态PathInfo配置

location / {
    if (!-d $request_filename){
			set $rule_0 1$rule_0;
	}
	if (!-f $request_filename){
			set $rule_0 2$rule_0;
	}
	if ($rule_0 = "21"){
			rewrite ^/(.*)$ /index.php/$1 last;
	}

}

location ~ .*\.(php|php5)(.*)?$ {
	 fastcgi_pass 127.0.0.1:9000;
	 fastcgi_index index.php;
	 fastcgi_split_path_info ^(.+\.php)(/.+)$;
	 fastcgi_param PATH_INFO $fastcgi_path_info;
	 fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
	 include /usr/local/nginx/conf/fastcgi.conf;
}


作者:lzcz 分类:经验分享 浏览:322 评论:0