Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion dev2/dev2-edge
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,12 @@ def caddy_site(site, s):
lines.append("\tencode gzip")
if site.get("access_log"):
lines += ["\tlog {", f"\t\toutput file /var/log/caddy/{site['hosts'][0]}.access.log", "\t}"]
if "proxy" in site:
if "proxy" in site and site.get("retry"):
# While the app restarts (a deploy), hold the request and keep dialing instead of
# answering 502: webhooks that drive live calls (Telnyx) must not fail mid-call.
lines += [f"\treverse_proxy 127.0.0.1:{int(site['proxy'])} {{", "\t\theader_up X-Real-IP {remote_host}",
"\t\tstream_close_delay 1h", f"\t\tlb_try_duration {site['retry']}", "\t\tlb_try_interval 250ms", "\t}"]
elif "proxy" in site:
lines.append(f"\timport edge_proxy {int(site['proxy'])}")
elif "root" in site:
lines += [f"\troot * {site['root']}", "\tfile_server"]
Expand Down
4 changes: 2 additions & 2 deletions dev2/edge/edge.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
{ "hosts": ["pit.world"], "proxy": 8787, "max_body": "1MiB" },
{ "hosts": ["www.pit.world"], "redirect": "https://pit.world{uri}" },
{ "hosts": ["ad.network.pit.world"], "proxy": 8800, "max_body": "1MiB", "gzip": true },
{ "hosts": ["group.call.pit.world"], "proxy": 8810, "max_body": "1MiB",
"//": "group.call (moshcoder/group.call): no gzip, so the room page's server-sent events are not held back" },
{ "hosts": ["group.call.pit.world"], "proxy": 8810, "max_body": "1MiB", "retry": "20s",
"//": "group.call (moshcoder/group.call): no gzip, so the room page's server-sent events are not held back; retry holds Telnyx webhooks across a deploy instead of 502" },
{ "hosts": ["*.*.pit.world", "*.*.*.pit.world"], "proxy": 8787, "max_body": "30MiB", "gzip": true,
"//": "pit-proxy: every <name>.pit.world (+ bbs./social.) relayed by the pit.world app; one Let's Encrypt certificate per name from pit-proxy-cert" },
{ "hosts": ["built.indie"], "proxy": 8798, "max_body": "1MiB", "moshpit": true },
Expand Down
Loading