1location / {
2 index index.html index.php;
3 if (-f $request_filename/index.html){
4 rewrite (.*) $1/index.html break;
5 }
6 if (-f $request_filename/index.php){
7 rewrite (.*) $1/index.php;
8 }
9 if (!-f $request_filename){
10 rewrite (.*) /index.php;
11 }
12}
13fastcgi_split_path_info ^(.+?\.php)(/.*)$;
14set $path_info $fastcgi_path_info;
15fastcgi_param PATH_INFO $path_info;
16try_files $fastcgi_script_name =404;