Files
aggios.app/traefik/dynamic/rules.yml
2025-12-08 21:47:38 -03:00

51 lines
1.2 KiB
YAML

# Traefik Dynamic Configuration - Multi-tenant Routing Rules
http:
middlewares:
security-headers:
headers:
customResponseHeaders:
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-XSS-Protection: "1; mode=block"
routers:
# API Backend Router (only api.localhost)
api-router:
entryPoints:
- web
rule: "Host(`api.localhost`)"
middlewares:
- security-headers
service: api-service
# Dashboard Router (dash.localhost for SUPERADMIN)
dashboard-main-router:
entryPoints:
- web
rule: "Host(`dash.localhost`)"
priority: 2
middlewares:
- security-headers
service: dashboard-service
# Multi-tenant Dashboard Router (agency subdomains)
dashboard-tenant-router:
entryPoints:
- web
rule: "HostRegexp(`^.+\\.localhost$`)"
priority: 1
middlewares:
- security-headers
service: dashboard-service
services:
api-service:
loadBalancer:
servers:
- url: http://backend:8080
dashboard-service:
loadBalancer:
servers:
- url: http://dashboard:3000