使用caddy搭建文件服务器
1. caddy介绍
caddy官网:https://caddyserver.com/ 项目源码:https://github.com/caddyserver/caddy
2. 下载caddy
从官网下载caddy,下载时选择需要的插件
3. 创建工作路径
mkdir caddy-workspace
cd caddy-workspace
4. 创建Caddyfile
192.168.9.105:8888 {
gzip
root filebrowser
log access.log
errors errors.log
filebrowser / filebrowser/files {
database /root/df/caddy/filebrowser/filebrowser.db
}
}
192.168.9.105:9999 {
gzip
browse
root yum.repo
log access.log
errors errors.log
}
192.168.9.105:7777 {
gzip
browse
root static
log access.log
errors errors.log
}
192.168.9.105:80 {
proxy / http://192.168.103.147:80
}
192.168.9.105:5566 {
gzip
root test
}
5. 运行caddy
caddy &
6. 访问
http://192.168.9.105:8888