
location / {
index index.html index.htm index.php;
if (!-e $request_filename) {
rewrite ^(.*)$ /index.php?s=/$1 last;
break;
}
#autoindex on;
}
注意这里 如果框架是ThinkCMF,想要访问接口 还需要增加如下配置
location /api/ {
index index.php index.html index.htm;
if (!-e $request_filename)
{
rewrite ^/api/(.*)$ /api.php?s=$1;
}
}