ThinkPHP运行环境Apache转Nginx配置如下
只需要添加这行代码:
具体代码如下:
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; } }
原创文章,转载请注明:ThinkPHP运行环境Apache转Nginx配置如下 | 知识改变命运
转载请注明出处: 知识改变命运 » ThinkPHP运行环境Apache转Nginx配置如下