dynamic.yml 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. http:
  2. routers:
  3. # Redirect HTTP→HTTPS only for public domains (not .local or private IPs)
  4. http_redirect:
  5. rule: "HostRegexp(`{host:.+}`) && !HostRegexp(`{local:.+\\.local}`) && !HostRegexp(`{ip:192\\.168\\..+}`) && !HostRegexp(`{ip2:10\\..+}`) && !HostRegexp(`{ip3:172\\.(1[6-9]|2[0-9]|3[01])\\..+}`) && !HostRegexp(`{relay:.+\\.waouw\\.tech}`)"
  6. entryPoints:
  7. - web
  8. middlewares:
  9. - redirect_to_https
  10. service: noop@internal
  11. priority: 9999
  12. # Local access: serve backend API over HTTP (no TLS)
  13. backend_local:
  14. rule: "(HostRegexp(`{local:.+\\.local}`) || HostRegexp(`{ip:192\\.168\\..+}`) || HostRegexp(`{ip2:10\\..+}`)) && PathPrefix(`/api`)"
  15. entryPoints:
  16. - web
  17. service: backend_static
  18. priority: 5000
  19. # Local access: serve frontend over HTTP (no TLS)
  20. frontend_local:
  21. rule: "HostRegexp(`{local:.+\\.local}`) || HostRegexp(`{ip:192\\.168\\..+}`) || HostRegexp(`{ip2:10\\..+}`)"
  22. entryPoints:
  23. - web
  24. service: frontend_static
  25. priority: 2
  26. # Relay tunnel: accept HTTP from WireGuard (10.100.x.x) without redirect
  27. # The relay terminates TLS, so the boîtier receives plain HTTP via the tunnel
  28. relay_backend:
  29. rule: "HostRegexp(`{host:.+\\.waouw\\.tech}`) && PathPrefix(`/api`)"
  30. entryPoints:
  31. - web
  32. service: backend_static
  33. priority: 6000
  34. relay_nextcloud:
  35. rule: "HostRegexp(`{host:cloud-.+\\.waouw\\.tech}`)"
  36. entryPoints:
  37. - web
  38. service: nextcloud_static
  39. priority: 5500
  40. # Relay: WaouW frontend for *.waouw.tech that don't match a site container
  41. relay_frontend:
  42. rule: "HostRegexp(`{host:.+\\.waouw\\.tech}`)"
  43. entryPoints:
  44. - web
  45. service: frontend_static
  46. priority: 3
  47. backend_static:
  48. rule: "PathPrefix(`/api`)"
  49. entryPoints:
  50. - websecure
  51. tls: {}
  52. service: backend_static
  53. priority: 1000
  54. frontend_static:
  55. rule: "PathPrefix(`/`)"
  56. entryPoints:
  57. - websecure
  58. tls: {}
  59. service: frontend_static
  60. priority: 1
  61. services:
  62. backend_static:
  63. loadBalancer:
  64. servers:
  65. - url: "http://waouw_backend:8000"
  66. frontend_static:
  67. loadBalancer:
  68. servers:
  69. - url: "http://waouw_frontend:80"
  70. nextcloud_static:
  71. loadBalancer:
  72. servers:
  73. - url: "http://waouw_nextcloud:80"
  74. middlewares:
  75. redirect_to_https:
  76. redirectScheme:
  77. scheme: https
  78. permanent: true
  79. # Alias with dashes (referenced by site containers)
  80. # In relay mode, this must NOT redirect because the relay already handles TLS
  81. # Using headers middleware instead of redirect to make it a no-op
  82. redirect-to-https:
  83. headers:
  84. customResponseHeaders:
  85. X-Forwarded-Proto: "https"