前端页面部署,在/config/caddy.d目录下 xxx.com { # 你的前端域名 root * /usr/share/caddy # 静态资源:JS、CSS、图片等缓存 1 年 @static { path *.js *.css *.png *.jpg *.jpeg *.gif *.ico *.svg *.woff *.woff2 } header @static Cache-Control "public, max-age=259200, immutable" # HTML 文件不缓存 @html { path *.html } header @html Cache-Control "no-cache, no-store, must-revalidate" # 静态文件需要的 file_server # 也可以直接在这里反向代理后端 }