php-fpm在使用框架时往往时单一入口的。这个配置很好的解决了这个问题。绝对是我的原创(但不排斥有不谋而合的)
//放过所有静态文件
if ($request_filename !~* "\.[a-z]{2,4}") {
rewrite ^(.*)$ /index_dev.php?s=$1 last;
break;
}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
//把所有的.PHP结尾文件重定向到INDEX.PHP
location ~ \.php$ {
add_header 'Access-Control-Allow-Origin' '*';
root html;
fastcgi_pass 127.0.0.1:9002;
fastcgi_index index.php;
#fastcgi_param SCRIPT_FILENAME C:/dev/www/www/developmentindex.php;
fastcgi_param SCRIPT_FILENAME C:/dev/index.php;
include fastcgi_params;
}