thinkphp5反人类的配置写法
server {
listen 80;
server_name www.baidu.com;
index index.php index.html index.htm;
set $root /data/www/public;
root $root;
if ( !-e $request_filename) {
rewrite ^(.*)$ /index.php/$1 last;
break;
}
access_log off;
client_max_body_size 80m;
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
location ~ .+\.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;
fastcgi_param PATH_INFO $path_info;
fastcgi_param SCRIPT_FILENAME $root$fastcgi_script_name;
fastcgi_param SCRIPT_NAME $script;
include fastcgi_params;
}
location ~ /\.ht {
deny all;
}
}
现在应该很少人用TP框架了吧,真的不好用。