updated Caddyfile

Signed-off-by: Kenneth Obsequio <k80308392@gmail.com>
This commit is contained in:
2026-08-29 16:33:24 +08:00
parent e4538ed95a
commit ea0bca8b69
+3 -9
View File
@@ -2,6 +2,9 @@
# Not needed for local testing against localhost:4650 — this is the step you # Not needed for local testing against localhost:4650 — this is the step you
# take once you're actually putting this in front of a public domain. # take once you're actually putting this in front of a public domain.
# #
# Our recommendations where to deploy this streamable online course and training platform
# is only either Cloudflare (with Tunnels For free) or other cloud VPS platforms (DigitalOcean,Google et.al)
#
# Usage: # Usage:
# 1. Point 3 DNS records at this machine: your app domain, your api # 1. Point 3 DNS records at this machine: your app domain, your api
# subdomain, and your cdn subdomain (matching FRONTEND_URL / APP_URL / # subdomain, and your cdn subdomain (matching FRONTEND_URL / APP_URL /
@@ -22,12 +25,6 @@
{ {
servers { servers {
# Only matters once something else (Cloudflare, another load balancer)
# sits in front of this Caddy instance and forwards its own
# X-Forwarded-For — trusts that header from private/loopback ranges so
# {http.request.header.X-Real-IP} below reflects the real visitor, not
# whatever's immediately upstream of Caddy. Harmless no-op if Caddy is
# the outermost edge (the common case for a single self-hosted box).
trusted_proxies static private_ranges trusted_proxies static private_ranges
client_ip_headers X-Forwarded-For X-Real-IP client_ip_headers X-Forwarded-For X-Real-IP
} }
@@ -48,9 +45,6 @@
{$API_DOMAIN:api.yourdomain.com} { {$API_DOMAIN:api.yourdomain.com} {
encode gzip zstd encode gzip zstd
# server.js already sets `app.set('trust proxy', 1)` for the rate
# limiter — Caddy's reverse_proxy adds X-Forwarded-For automatically, so
# real client IPs reach express-rate-limit without extra config here.
reverse_proxy localhost:3024 { reverse_proxy localhost:3024 {
header_up X-Real-IP {http.request.header.X-Real-IP} header_up X-Real-IP {http.request.header.X-Real-IP}
} }