thinkphp5.x nginx服务器伪静态配置方法
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
server { listen 80; server_name **.com; root "C:/wwwroot/**/public"; location / { index index.html index.htm index.php default.php; //重点就是加入下面这个if if (!-e $request_filename){ rewrite ^(.*)$ /index.php?s=$1 last; break; } } location ~ .php(.*)$ { fastcgi_pass 127.0.0.1:18158; fastcgi_index index.html; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_split_path_info ^(.+.php)(.*)$; fastcgi_param PATH_INFO $fastcgi_path_info; include fastcgi_params; } } |