Repository navigation
Expand file tree
/
Copy pathCaddyfile
More file actions
81 lines (77 loc) · 2.87 KB
/
Copy pathCaddyfile
File metadata and controls
81 lines (77 loc) · 2.87 KB
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
{
email admin@{$PDS_HOSTNAME:pds.example}
on_demand_tls {
ask http://{$PDS_UPSTREAM:core:3000}/tls-check
}
}
# Demo app (dedicated vhost — not part of the on-demand TLS block so it
# bypasses /tls-check). Only active when DEMO_HOSTNAME is set; in its
# absence Caddy just skips this site. Used for local e2e runs where the
# demo container needs a real hostname under the shared parent domain
# so HYPER-268 @session-reuse scenarios can exercise cross-client
# device-session sharing.
{$DEMO_HOSTNAME} {
reverse_proxy {$DEMO_UPSTREAM:demo:3002} {
header_up Connection {http.request.header.Connection}
header_up Upgrade {http.request.header.Upgrade}
}
header {
Strict-Transport-Security "max-age=63072000; includeSubDomains; preload"
X-Content-Type-Options "nosniff"
}
}
# Second demo vhost for e2e scenarios that need an untrusted OAuth client
# (HYPER-268 session-reuse, trusted-vs-untrusted branding tests). Only
# active when DEMO_UNTRUSTED_HOSTNAME is set. Same container image as the
# trusted demo, different PUBLIC_URL.
{$DEMO_UNTRUSTED_HOSTNAME} {
reverse_proxy {$DEMO_UNTRUSTED_UPSTREAM:demo-untrusted:3002} {
header_up Connection {http.request.header.Connection}
header_up Upgrade {http.request.header.Upgrade}
}
header {
Strict-Transport-Security "max-age=63072000; includeSubDomains; preload"
X-Content-Type-Options "nosniff"
}
}
# Mailpit UI for manual email inspection during local dev / e2e runs.
# Mailpit's own HTTP Basic auth (MP_UI_AUTH) protects the endpoint so no
# extra Caddy-level auth is needed. Only active when MAILPIT_HOSTNAME is set.
{$MAILPIT_HOSTNAME} {
reverse_proxy {$MAILPIT_UPSTREAM:mailpit:8025} {
header_up Connection {http.request.header.Connection}
header_up Upgrade {http.request.header.Upgrade}
}
header {
Strict-Transport-Security "max-age=63072000; includeSubDomains; preload"
X-Content-Type-Options "nosniff"
}
}
# PDS API + handle subdomains (on-demand TLS for handle resolution)
:443 {
tls {
on_demand
}
# Auth service
@auth host auth.{$PDS_HOSTNAME:pds.example}
handle @auth {
reverse_proxy {$AUTH_UPSTREAM:auth:3001}
header {
X-Frame-Options "DENY"
X-Content-Type-Options "nosniff"
Referrer-Policy "no-referrer"
Strict-Transport-Security "max-age=63072000; includeSubDomains; preload"
}
}
# Everything else goes to PDS (main domain + handle subdomains)
handle {
reverse_proxy {$PDS_UPSTREAM:core:3000} {
header_up Connection {http.request.header.Connection}
header_up Upgrade {http.request.header.Upgrade}
}
header {
Strict-Transport-Security "max-age=63072000; includeSubDomains; preload"
X-Content-Type-Options "nosniff"
}
}
}