Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
86 lines
2.1 KiB
Caddyfile
86 lines
2.1 KiB
Caddyfile
{
|
|
acme_ca https://acme-v02.api.letsencrypt.org/directory
|
|
# Bound the buffers: on 2026-09-30 caddy reached 5.9 GB anon-rss and the kernel
|
|
# OOM-killed it three times, which took the whole site and API down with it.
|
|
servers {
|
|
trusted_proxies static 127.0.0.1/32 # TODO: your edge/CDN proxy CIDR
|
|
trusted_proxies_strict
|
|
timeouts {
|
|
read_body 60s
|
|
read_header 30s
|
|
write 1h
|
|
idle 5m
|
|
}
|
|
}
|
|
}
|
|
|
|
(api_common) {
|
|
# API requests are not logged: no access log.
|
|
header {
|
|
Strict-Transport-Security "max-age=15552000; includeSubDomains"
|
|
X-Content-Type-Options "nosniff"
|
|
Referrer-Policy "strict-origin-when-cross-origin"
|
|
-Server
|
|
}
|
|
request_body {
|
|
max_size 40MB
|
|
}
|
|
}
|
|
|
|
api.your-domain.com {
|
|
import api_common
|
|
# Media/TTS (/v1/media/*) is NOT routed here: this repo ships no media adapter.
|
|
# The gateway skin proxies every /v1/* path to the upstream. If you run an
|
|
# operator-run adapter on loopback,
|
|
# add your own route above the catch-all:
|
|
#
|
|
# handle /v1/media/* {
|
|
# reverse_proxy 127.0.0.1:<your-adapter-port> {
|
|
# flush_interval -1
|
|
# transport http {
|
|
# read_timeout 300s
|
|
# dial_timeout 10s
|
|
# }
|
|
# }
|
|
# }
|
|
# [WEBAPP-WIRE 19.10] Mini App: /webapp -> 127.0.0.1:8850
|
|
handle /webapp {
|
|
redir /webapp/ 301
|
|
}
|
|
handle_path /webapp/* {
|
|
reverse_proxy 127.0.0.1:8850 {
|
|
header_up X-Real-IP {client_ip}
|
|
flush_interval -1
|
|
transport http {
|
|
read_timeout 60s
|
|
dial_timeout 5s
|
|
}
|
|
}
|
|
}
|
|
handle {
|
|
reverse_proxy 127.0.0.1:48001 {
|
|
header_up X-Forwarded-For {client_ip}
|
|
# generations and SSE streams outlive the defaults; "context canceled" /
|
|
# "http2: stream closed" in the error log were proxies giving up early
|
|
flush_interval -1
|
|
transport http {
|
|
read_timeout 900s
|
|
dial_timeout 10s
|
|
keepalive 30s
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
your-domain.com {
|
|
import api_common
|
|
reverse_proxy 127.0.0.1:48001 {
|
|
header_up X-Forwarded-For {client_ip}
|
|
flush_interval -1
|
|
transport http {
|
|
read_timeout 900s
|
|
dial_timeout 10s
|
|
}
|
|
}
|
|
}
|