自己的博客想要利用https,
而且比较nginx,Caddy支配起来更大略,就一个二进制文件;
CaddyFile配置更大略,很多都是默认配置,只要根据自己的情形,添加须要的参数即可。

功能丰富,但是很多我暂时用不到,用到再通过插件的办法添加即可。
对付一个博客运用来说完备够用了。
安装Caddy
在CentOS上可以直策应用yum安装的,也可以下载对应平台的二进制进行安装。
安装命令:
yum install yum-plugin-copr -yyum copr enable @caddy/caddy -yyum install caddy -y
配置
配置文件默认是在/etc/caddy/Caddyfile,配置文件只要修恰好自己的域名,如果须要https直接填写上http://xxx就可以了,root实行自己的网站目录即可。
我的网站是hugo天生的静态站,直接配置目录。
如果是php可以直接转发的php_fastcgi。
# The Caddyfile is an easy way to configure your Caddy web server.## Unless the file starts with a global options block, the first# uncommented line is always the address of your site.## To use your own domain name (with automatic HTTPS), first make# sure your domain's A/AAAA DNS records are properly pointed to# this machine's public IP, then replace ":80" below with your# domain name.www.opcai.top https://www.opcai.top http://opcai.top https://opcai.top { # Set this path to your site's directory. root /data/webroot # Enable the static file server. file_server # Another common task is to set up a reverse proxy: # reverse_proxy /back/ localhost:8080 # Or serve a PHP site through php-fpm: # php_fastcgi localhost:9000}# Refer to the Caddy docs for more information:# https://caddyserver.com/docs/caddyfile
做事管理
systemctl enable --now caddy # 启动并设置开机启动systemctl reload caddy # 重载配置
总结
Caddy还有很多强大的功能,逐步探索。