forked from DevOps/deploy.stack
25 lines
782 B
Plaintext
25 lines
782 B
Plaintext
yourdomain.com {
|
|
# 自动申请 TLS 证书
|
|
tls your_email@example.com
|
|
# CouchDB 路径路由
|
|
handle_path /couchdb/* {
|
|
# 重写路径 (去掉 /couchdb 前缀)
|
|
rewrite * /{path.trim_prefix('/couchdb')}
|
|
# 反向代理到本地 CouchDB
|
|
reverse_proxy http://localhost:5984 {
|
|
# 关键头部设置
|
|
header_up Host {http.reverse_proxy.upstream.hostport}
|
|
header_up X-Forwarded-For {client_host}
|
|
header_up X-Forwarded-Proto https
|
|
|
|
# 可选:调整超时设置
|
|
transport http {
|
|
keepalive 300s
|
|
}
|
|
}
|
|
}
|
|
# 可选:非/couchdb路径的默认响应
|
|
handle {
|
|
respond "CouchDB available at /couchdb/" 404
|
|
}
|
|
} |