yuantuo666 / baiduwp-php

A tool to get the download link of the Baidu netdisk / 一个获取百度网盘分享链接下载地址的工具
MIT License
6.5k stars 1.4k forks source link

【寻求帮助】请给出nginx环境的静态.htaccess规则 #357

Closed qiurigao closed 8 months ago

qiurigao commented 9 months ago

.htaccess转换成nginx规则

yuantuo666 commented 9 months ago

本项目使用 ThinkPHP 框架,请查阅相关文档进行配置:https://doc.thinkphp.cn/v8_0/url_access.html

ghost commented 8 months ago

添加这段代码即可

    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;
    }
}
yuantuo666 commented 8 months ago

如有问题请重新打开此议题。