thinkphp 之windows->Linux apache->nginx

服务器迁移

windows->Linux

apache->nginx

 

配置如下:

thinkphp->’URL_MODEL’ => 3

#所有找不到的请求转到index处理

location / {
index index.html index.htm index.php;
if (!-e $request_filename){
rewrite ^(.*)$ /index.php/$1 last;
break;
}
}

#其他处理
location ~ .*\.(php|php5)?$
{
#fastcgi_pass  unix:/tmp/php-cgi.sock;
fastcgi_pass  127.0.0.1:9000;
fastcgi_index index.php;
include fcgi.conf;
}

#index的处理

location ~ index\.php($|/) {
set $script     $uri;
set $path_info  “/”;
if ($uri ~ “^(.+\.php)(/.+)”) {
set $script     $1;
set $path_info  $2;
}

fastcgi_pass   127.0.0.1:9000;
fastcgi_index  index.php?IF_REWRITE=1;
include fastcgi_params;
fastcgi_param PATH_INFO $path_info;
fastcgi_param  SCRIPT_FILENAME  /url/index.php;
fastcgi_param SCRIPT_NAME “”;
}

评论关闭