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 實踐,分享軟體工具、數位體驗,以及程式碼之外的見聞與思考。