Caddyfile 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. # Dashboard
  2. https://dashboard.{$NM_DOMAIN} {
  3. tls /root/certs/fullchain.pem /root/certs/privkey.pem
  4. # Apply basic security headers
  5. header {
  6. # Enable cross origin access to *.{$NM_DOMAIN}
  7. Access-Control-Allow-Origin *.{$NM_DOMAIN}
  8. # Enable HTTP Strict Transport Security (HSTS)
  9. Strict-Transport-Security "max-age=31536000;"
  10. # Enable cross-site filter (XSS) and tell browser to block detected attacks
  11. X-XSS-Protection "1; mode=block"
  12. # Disallow the site to be rendered within a frame on a foreign domain (clickjacking protection)
  13. X-Frame-Options "SAMEORIGIN"
  14. # Prevent search engines from indexing
  15. X-Robots-Tag "none"
  16. # Remove the server name
  17. -Server
  18. }
  19. reverse_proxy http://netmaker-ui
  20. }
  21. # API
  22. https://api.{$NM_DOMAIN} {
  23. tls /root/certs/fullchain.pem /root/certs/privkey.pem
  24. reverse_proxy http://netmaker:8081
  25. }
  26. # STUN
  27. https://stun.{$NM_DOMAIN} {
  28. tls /root/certs/fullchain.pem /root/certs/privkey.pem
  29. reverse_proxy netmaker:3478
  30. }
  31. # TURN
  32. https://turn.{$NM_DOMAIN} {
  33. tls /root/certs/fullchain.pem /root/certs/privkey.pem
  34. reverse_proxy host.docker.internal:3479
  35. }
  36. # TURN API
  37. https://turnapi.{$NM_DOMAIN} {
  38. tls /root/certs/fullchain.pem /root/certs/privkey.pem
  39. reverse_proxy http://host.docker.internal:8089
  40. }
  41. # MQ
  42. wss://broker.{$NM_DOMAIN} {
  43. tls /root/certs/fullchain.pem /root/certs/privkey.pem
  44. reverse_proxy ws://mq:8883 # For EMQX websockets use `reverse_proxy ws://mq:8083`
  45. }