Caddy

Caddy

安装 — Caddy v2中文文档 (dengxiaolong.com)

与Nginx一样,Caddy也可以实现域名反代

我们通过使用CaddyFile的方式,来实现域名反代

Caddyfile 快速入门 — Caddy v2中文文档 (dengxiaolong.com)

Caddy的配置文件: /etc/caddy/caddyfile

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# 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.

blog.170827.xyz:80 {
encode gzip
reverse_proxy localhost:8090
}
webdav.170827.xyz:80 {
encode gzip
reverse_proxy localhost:8060
}
zfile.170827.xyz:80 {
encode gzip
reverse_proxy localhost:8100
}
# Refer to the Caddy docs for more information:
# https://caddyserver.com/docs/caddyfile

Cloudflare中,我们将三个二级域名解析到同一台服务器

通过Caddy,我们将不同端口的应用分别反代到不同的二级域名上



Caddy
http://blog.170827.xyz/2024/05/08/Caddy/
作者
XIAOBAI
发布于
2024年5月8日
许可协议