Files
nexus/wiki/concepts/Caddy.md
2026-04-14 16:02:50 +08:00

47 lines
911 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
title: "Caddy"
type: concept
tags: [caddy, reverse-proxy, https, web-server]
last_updated: 2026-04-13
---
## Definition
Caddy是现代化Web服务器自动提供HTTPS并支持反向代理。
## 核心特性
- 自动Let's Encrypt证书申请
- 自动HTTP→HTTPS重定向
- 支持反向代理和负载均衡
- 配置简洁
## 在家庭网络中的用途
- 反向代理内网服务到公网域名
- HTTPS终端处理
- 多域名统一管理
## Caddyfile配置示例
```caddy
n8n.ishenwei.online {
reverse_proxy 127.0.0.1:15678
}
nas.ishenwei.online {
reverse_proxy 127.0.0.1:15000
}
```
## 常用命令
```bash
# 验证配置
sudo caddy validate --config /etc/caddy/Caddyfile
# 重载配置
sudo systemctl reload caddy
# 重启服务
sudo systemctl restart caddy
```
## 相关文档
- [[通过VPS+内网反向代理实现域名访问内网穿透]]
- [[家庭网络环境概览 2026-04-03]]