Closed qiurigao closed 8 months ago
本项目使用 ThinkPHP 框架,请查阅相关文档进行配置:https://doc.thinkphp.cn/v8_0/url_access.html
添加这段代码即可
location / {
if (!-f $request_filename) {
rewrite ^(.*)$ /index.php?s=/$1 last;
}
}
下面是我用的配置,可以参考一下,别直接拿来用,可能会报错。
server {
listen [::]:8003 ipv6only=off;
root /data/data/com.termux/files/home/nginx/vhost/baiduwp/public;
index index.php index.html;
location / {
if (!-f $request_filename) {
rewrite ^(.*)$ /index.php?s=/$1 last;
}
}
location ~ \.php?.*$ {
fastcgi_pass unix://data/data/com.termux/files/usr/var/run/php-fpm.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
如有问题请重新打开此议题。
.htaccess转换成nginx规则