编程技术分享平台

网站首页 > 技术教程 正文

Chevereto 图床系统的 Nginx 伪静态 Rewrite 规则

xnh888 2024-09-16 07:36:45 技术教程 23 ℃ 0 评论

Chevereto

是目前最为强大的 PHP 图床系统,通过它可部署多用户公开或私有的图片存储服务;

项目地址:

https://github.com/Chevereto/Chevereto-Free

伪静态规则

Chevereto 默认提供基于 Apache 环境的,如果服务器是 Nginx 则需要设置以下Rewrite 伪静态规则:

location / {
 if (-f $request_filename/index.html){
 rewrite (.*) $1/index.html break;
 }
 if (-f $request_filename/index.php){
 rewrite (.*) $1/index.php;
 }
 if (!-f $request_filename){
 rewrite (.*) /index.php;
 }
 try_files $uri $uri/ /api.php;
}
location /admin {
 try_files $uri /admin/index.php?$args;
}

享受战斗成果!

Tags:

本文暂时没有评论,来添加一个吧(●'◡'●)

欢迎 发表评论:

最近发表
标签列表