Skip to content

Commit 00c8385

Browse files
committed
Adjusting proxy config
1 parent 7a8e2f8 commit 00c8385

1 file changed

Lines changed: 30 additions & 6 deletions

File tree

apps/proxy/prod.Caddyfile

Lines changed: 30 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,40 @@
11
:8080 {
2-
redir /auth /auth/
3-
handle /auth/* {
4-
uri strip_prefix /auth
5-
reverse_proxy auth:8080
6-
}
7-
82
redir /api /api/
93
handle /api/* {
104
uri strip_prefix /api
115
reverse_proxy hasura:8080
126
}
137

8+
# Strict Content Security Policy for production
9+
header {
10+
# Remove server identification headers
11+
-Server
12+
-X-Powered-By
13+
14+
# Security headers
15+
X-Frame-Options "DENY"
16+
X-Content-Type-Options "nosniff"
17+
Referrer-Policy "strict-origin-when-cross-origin"
18+
X-XSS-Protection "1; mode=block"
19+
Permissions-Policy "camera=(), microphone=(), geolocation=(), payment=(), usb=(), magnetometer=(), gyroscope=(), accelerometer=()"
20+
21+
# Strict Transport Security (HSTS) - enable if using HTTPS
22+
# Strict-Transport-Security "max-age=31536000; includeSubDomains; preload"
23+
24+
# Production CSP
25+
# Using hash for inline script instead of 'unsafe-inline'
26+
Content-Security-Policy "default-src 'self'; script-src 'self' 'wasm-unsafe-eval' 'sha256-HlD9D/WlEaVKKAvDnldsXkj/nllO8aCRBvtofUTEnGQ='; style-src 'self' 'unsafe-inline'; img-src 'self' data: https:; font-src 'self' data:; connect-src 'self' wss://*.zxcoder.org https://*.zxcoder.org; worker-src 'self' blob:; child-src 'self' blob:; frame-src 'none'; object-src 'none'; base-uri 'self'; form-action 'self'; upgrade-insecure-requests; block-all-mixed-content"
27+
28+
# CSP Report endpoint (optional - set up monitoring)
29+
# Report-To "{\"group\":\"csp-endpoint\",\"max_age\":10886400,\"endpoints\":[{\"url\":\"https://your-report-collector.example.com/csp-reports\"}]}"
30+
}
31+
32+
redir /auth /auth/
33+
handle /auth/* {
34+
uri strip_prefix /auth
35+
reverse_proxy auth:8080
36+
}
37+
1438
handle {
1539
reverse_proxy web:8080
1640
}

0 commit comments

Comments
 (0)