Caddyfile53 lines · main
| 1 | # briven data-plane reverse proxy — Phase 6 of BACKEND_FORK_BRIEF.md. |
| 2 | # Strips identifying upstream headers (Server, X-Powered-By, Via) so no |
| 3 | # response leaving the trust zone names a backend component. Replaces |
| 4 | # the upstream Kong API gateway per plan §1. |
| 5 | |
| 6 | { |
| 7 | admin off |
| 8 | } |
| 9 | |
| 10 | {$BRIVEN_PUBLIC_HOST:api.briven.tech} { |
| 11 | header { |
| 12 | -Server |
| 13 | -X-Powered-By |
| 14 | -Via |
| 15 | Server "briven" |
| 16 | Strict-Transport-Security "max-age=63072000" |
| 17 | X-Content-Type-Options "nosniff" |
| 18 | Referrer-Policy "strict-origin-when-cross-origin" |
| 19 | } |
| 20 | |
| 21 | handle_path /rest/v1/* { |
| 22 | reverse_proxy http://rest:3000 { |
| 23 | header_down -Server |
| 24 | header_down -X-Powered-By |
| 25 | } |
| 26 | } |
| 27 | |
| 28 | handle_path /auth/v1/* { |
| 29 | reverse_proxy http://auth:9999 { |
| 30 | header_down -Server |
| 31 | header_down -X-Powered-By |
| 32 | } |
| 33 | } |
| 34 | |
| 35 | handle_path /realtime/v1/* { |
| 36 | reverse_proxy http://realtime:4000 { |
| 37 | header_down -Server |
| 38 | header_down -X-Powered-By |
| 39 | } |
| 40 | } |
| 41 | |
| 42 | handle_path /pg/* { |
| 43 | reverse_proxy http://meta:8080 { |
| 44 | header_down -Server |
| 45 | header_down -X-Powered-By |
| 46 | } |
| 47 | } |
| 48 | |
| 49 | respond 404 { |
| 50 | body `{"error":"not_found"}` |
| 51 | close |
| 52 | } |
| 53 | } |