[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