-
-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathCaddyfile
More file actions
41 lines (34 loc) · 900 Bytes
/
Caddyfile
File metadata and controls
41 lines (34 loc) · 900 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# Caddyfile for Changerawr with on-demand TLS
# Caddy automatically obtains and renews Let's Encrypt certificates
{
# Global options
email {$ACME_EMAIL}
# Enable on-demand TLS with ask endpoint
on_demand_tls {
ask http://app:3000/api/domain-check
}
}
# Catch-all for custom domains
:80, :443 {
# Enable on-demand TLS for all incoming requests
tls {
on_demand
}
# Reverse proxy all requests to the Next.js app
reverse_proxy app:3000 {
# Pass original host header
header_up Host {host}
# Pass real IP and protocol
header_up X-Real-IP {remote_host}
header_up X-Forwarded-For {remote_host}
header_up X-Forwarded-Proto {scheme}
header_up X-Forwarded-Host {host}
}
# Enable compression
encode gzip
# Logging
log {
output stdout
format console
}
}