[Caddy2] Caddyfile 靜態文件托管 file_server 的 hide 用法


通過llama.cpp與羊駝聊天的網頁界面- 詳解 Serge 的啟動使用

 

file_server 語法:

file_server [<matcher>] [browse] {
    root          <path>
    hide          <files...>
    index         <filenames...>
    browse        [<template_file>]
    precompressed <formats...>
    status        <status>
    disable_canonical_uris
    pass_thru
}

 

隱藏單個文件:

your_host {
    root * /xx/project_path
    encode gzip
    file_server {
        hide .gitignore
    }
}

 

隱藏文件夾及其里面內容:

your_host {
    root * /xx/project_path
    encode gzip
    file_server {
        hide .git .git/ .git/* .git* .gitignore
    }
}

注意:hide 指定如果不加絕對路徑,那么就是相對於 root 位置的路徑。

 

Tool:RESTClient

Refer:Caddy2 file_server 用法

Refer:https://caddyserver.com/docs/caddyfile/directives/file_server

Link:https://www.cnblogs.com/farwish/p/16032780.htm


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM