Caddy v2 部署 vue react 单页面应用并反向代理

直接上配置

example.com {#绑定的地址 域名或者 hostname:prot   形式

handle /api/* {  #需要代理得/api/得请求到后台  8000
	reverse_proxy backend:8000
}

handle {
	root * /path/to/site   #webpak 打包后的静态文件
	try_files {path} /index.html
	file_server
    encode    zstd   gzip  #开启zip
}

}

 

posted @ 2022-05-25 17:19  天朝95  阅读(832)  评论(0编辑  收藏  举报