tp5 rewrite 配置

server {
listen 80;
server_name test.wqzsub.com;
location / {
root /var/www/test;
index index.php index.html index.htm;
if (!-e $request_filename) {
rewrite ^(.*)$ /index.php?s=$1 last;
break;
}/*主要加了这一块*/
}

location ~ \.php$ {
root /var/www/test;
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}

posted @ 2020-08-25 11:42  kravis  阅读(233)  评论(0编辑  收藏  举报