-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathCaddyfile
More file actions
40 lines (35 loc) · 1.13 KB
/
Copy pathCaddyfile
File metadata and controls
40 lines (35 loc) · 1.13 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
# EPI Gateway — Caddy reverse proxy with automatic HTTPS
#
# Usage:
# docker compose -f docker-compose.yml -f docker-compose.prod.yml up -d
#
# Replace "epi.example.com" with your actual domain.
# Caddy obtains and renews a Let's Encrypt certificate automatically.
#
# For local self-signed HTTPS (no domain), replace the hostname with:
# localhost
# Caddy will issue a locally-trusted cert via its built-in CA.
epi.example.com {
# Forward all traffic to the gateway container
reverse_proxy gateway:8787
# Compress responses
encode gzip
# Security headers
header {
Strict-Transport-Security "max-age=31536000; includeSubDomains"
X-Content-Type-Options nosniff
X-Frame-Options DENY
Referrer-Policy strict-origin-when-cross-origin
}
# Expose Prometheus metrics only to internal scrape (remove block to open)
@metrics path /metrics
handle @metrics {
# Allow only localhost / internal network to scrape metrics.
# Comment this block out if your Prometheus is external.
respond "Forbidden" 403
}
log {
output stdout
format json
}
}