9router combo models (deepseek-v4-flash-free fallback) have TTFT up to 30-40s. Default (proxy) response_header_timeout 30s / read 60s caused false-positive 504 'timeout awaiting response headers' even while 9router was processing. Give the 9router route dedicated long timeouts (response_header 120s, read/write 300s). Syncs /etc/caddy/Caddyfile.
122 lines
2.5 KiB
Caddyfile
122 lines
2.5 KiB
Caddyfile
# ── Caddyfile PRODUKSI v2 — TUNED (auto-TLS Let's Encrypt) ──
|
|
# Tuning: HTTP/3 default, keep-alive upstream, zstd+gzip, timeouts, buffer, TLS 1.3
|
|
{
|
|
email asepharyana@gmail.com
|
|
|
|
# Global tuning
|
|
servers {
|
|
protocols h1 h2 h3
|
|
trusted_proxies static private_ranges
|
|
}
|
|
grace_period 10s
|
|
}
|
|
|
|
# ── Helper: handler umum (gzip + zstd, header keamanan) — dipanggil dgn argumen: port
|
|
# Penggunaan: import proxy 4003
|
|
(proxy) {
|
|
encode zstd gzip
|
|
header {
|
|
-Server
|
|
X-Content-Type-Options "nosniff"
|
|
X-Frame-Options "SAMEORIGIN"
|
|
Referrer-Policy "strict-origin-when-cross-origin"
|
|
}
|
|
# Keep-alive upstream: max 100 idle conns per host, dial timeout 3s
|
|
reverse_proxy 127.0.0.1:{args[0]} {
|
|
transport http {
|
|
keepalive 120s
|
|
keepalive_interval 30s
|
|
max_conns_per_host 100
|
|
dial_timeout 3s
|
|
response_header_timeout 30s
|
|
read_timeout 60s
|
|
write_timeout 60s
|
|
}
|
|
}
|
|
}
|
|
|
|
asepharyana.my.id, www.asepharyana.my.id, asepharyana.web.id, www.asepharyana.web.id, hub.asepharyana.my.id {
|
|
import proxy 4003
|
|
}
|
|
|
|
scraper.asepharyana.my.id, api.asepharyana.my.id, scraper.asepharyana.web.id, api.asepharyana.web.id {
|
|
import proxy 4091
|
|
}
|
|
|
|
ai.asepharyana.my.id, ai.asepharyana.web.id {
|
|
import proxy 4010
|
|
}
|
|
|
|
tools.asepharyana.my.id, tools.asepharyana.web.id {
|
|
import proxy 4007
|
|
}
|
|
|
|
9router.asepharyana.my.id {
|
|
# LLM streaming: 9router combo models punya TTFT sampe 30-40s (deepseek,
|
|
# fallback chain). Default (proxy) response_header_timeout 30s / read 60s
|
|
# bikin false-positive 504 walau 9router masih ngolah. Longgarkan khusus
|
|
# biar health-check & request PR-Agent real gak kena timeout transient.
|
|
encode zstd gzip
|
|
header {
|
|
-Server
|
|
X-Content-Type-Options "nosniff"
|
|
}
|
|
reverse_proxy 127.0.0.1:4014 {
|
|
transport http {
|
|
dial_timeout 3s
|
|
response_header_timeout 120s
|
|
read_timeout 300s
|
|
write_timeout 300s
|
|
}
|
|
}
|
|
}
|
|
|
|
pr-agent.asepharyana.my.id {
|
|
import proxy 4002
|
|
}
|
|
|
|
lidm.asepharyana.my.id {
|
|
import proxy 4004
|
|
}
|
|
|
|
lidm-api.asepharyana.my.id {
|
|
import proxy 4005
|
|
}
|
|
|
|
zeavisedu.asepharyana.my.id {
|
|
import proxy 4011
|
|
}
|
|
|
|
api-zeavisedu.asepharyana.my.id {
|
|
import proxy 4006
|
|
}
|
|
|
|
ml-zeavisedu.asepharyana.my.id {
|
|
import proxy 4012
|
|
}
|
|
|
|
dashboard.asepharyana.my.id {
|
|
import proxy 4013
|
|
}
|
|
|
|
imphnen.asepharyana.my.id {
|
|
import proxy 4009
|
|
}
|
|
|
|
upload.asepharyana.my.id, upload.asepharyana.web.id {
|
|
# Upload: no compression (binary), big body allowed, streaming
|
|
reverse_proxy 127.0.0.1:4000 {
|
|
transport http {
|
|
keepalive 120s
|
|
keepalive_interval 30s
|
|
max_conns_per_host 100
|
|
dial_timeout 3s
|
|
}
|
|
flush_interval -1
|
|
}
|
|
request_body {
|
|
max_size 0
|
|
}
|
|
}
|