-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCaddyfile.cluster
45 lines (42 loc) · 1.11 KB
/
Caddyfile.cluster
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
42
43
44
45
{
# Enable admin API for clustering
admin off
# Configure email for TLS certificates
email {$CADDY_EMAIL}
# Configure storage for clustering
storage s3 {
bucket {$CADDY_S3_BUCKET}
host {$CADDY_S3_ENDPOINT}
access_key {$CADDY_S3_ACCESS_KEY}
secret_key {$CADDY_S3_SECRET_KEY}
}
}
# HTTP to HTTPS redirect
http://*.{$PORTAL__CORE__DOMAIN}, http://{$PORTAL__CORE__DOMAIN} {
redir https://{host}{uri} permanent
}
# Handle wildcard HTTPS domains with DNS
*.{$PORTAL__CORE__DOMAIN} {
tls {
issuer acme {
resolvers 1.1.1.1 1.0.0.1
disable_tlsalpn_challenge
disable_http_challenge
propagation_delay 2m
dns cloudns {
auth_id "{$CLOUDNS_AUTH_ID}"
auth_password "{$CLOUDNS_AUTH_PASSWORD}"
}
}
}
reverse_proxy localhost:{$PORTAL__CORE__PORT}
}
# Handle root domain HTTPS without DNS
https://{$PORTAL__CORE__DOMAIN} {
tls {
issuer acme {
disable_tlsalpn_challenge
}
}
reverse_proxy localhost:{$PORTAL__CORE__PORT}
}