Thinkphp supports the use of pathinfo and URL rewrite to provide a friendly URL, just set the ' Url_model ' + 2 in the configuration file. Under Apache only need to open mod_rewrite module can be normal access, but nginx default is not support PathInfo, so nginx by default is not support thinkphp. However, we can modify the Nginx configuration file to support thinkphp.
Virtual Host configuration file: nginx/conf/vhost/127.0.0.1_8090.conf
server {listen8090;server_name127.0.0.1:8090;access_loglogs/127.0.0.1_8090.access.log main; Location/{ root /www/jingchang/jck;if (!-e $request _filename) { rewrite ^/(. *) $ /index.php/$1 Last ; break; }} Location ~ \.php { root /www/jingchang/jck;fastcgi_pass 127.0.0.1:9000;fastcgi_index index.php;include Fastcgi.conf;set $real _script_name $fastcgi _script_name;if ($fastcgi _script_name ~ "^ (. +?\.php) (/.+) $") { set $ Real_script_name $; Set $path _info;} Fastcgi_param script_filename $document _root$real_script_name;fastcgi_param script_name $real _script_name;fastcgi_ param path_info $path _info;}}
Nginx Open PathInfo Support thinkphp Framework Instance