Nginx 配置 Chevereto 伪静态规则

6,263 0

Chevereto 是目前最为强大的 PHP 图床系统,通过它可部署多用户公开或私有的图片存储服务,现在 Chevereto 出了免费的版本,小伙伴可以围观一下 https://github.com/Chevereto/Chevereto-Free

Chevereto 默认提供基于 Apache 环境的伪静态规则,如果服务器是 Nginx 的话,可以使用下面的伪静态规则

Nginx
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;
}

评论

(0)

暂无评论,来说两句吧

发布评论

© 2026 一纸忘忧. 保留所有权利.

一纸忘忧的个人网站,关于技术探索与日常生活,记录 Web 开发、服务端与 DevOps 实践,分享软件工具、数码体验,以及代码之外的见闻与思考。