2025-09-09 23:24:53 +08:00
|
|
|
yourdomain.com {
|
|
|
|
|
# 自动申请 TLS 证书
|
|
|
|
|
tls your_email@example.com
|
2025-09-10 00:42:18 +08:00
|
|
|
|
|
|
|
|
handle /couchdb/* {
|
|
|
|
|
@couch path /couchdb
|
|
|
|
|
redir @couch /couchdb/ permanent
|
|
|
|
|
handle_path /couchdb/* {
|
|
|
|
|
rewrite * /{path.trim_prefix('/couchdb')}
|
|
|
|
|
reverse_proxy http://10.0.0.2:5984 {
|
|
|
|
|
header_up Host {http.reverse_proxy.upstream.hostport}
|
|
|
|
|
header_up X-Forwarded-Prefix /couchdb
|
|
|
|
|
header_up Connection "upgrade"
|
2025-09-09 23:24:53 +08:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2025-09-10 00:42:18 +08:00
|
|
|
# 禁止直接访问根路径
|
2025-09-09 23:24:53 +08:00
|
|
|
handle {
|
2025-09-10 00:42:18 +08:00
|
|
|
respond "Access via /couchdb/" 403
|
2025-09-09 23:24:53 +08:00
|
|
|
}
|
2025-09-10 00:42:18 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
## 使用专用子域名 简单
|
|
|
|
|
# couchdb.yourdomain.com { # 使用专用子域名
|
|
|
|
|
# reverse_proxy http://localhost:5984 {
|
|
|
|
|
# header_up Host {http.reverse_proxy.upstream.hostport}
|
|
|
|
|
# }
|
|
|
|
|
# }
|