Caddyfile 915 B

12345678910111213141516171819202122232425262728293031323334
  1. # Dashboard
  2. https://dashboard.{$NM_DOMAIN} {
  3. # Apply basic security headers
  4. header {
  5. # Enable cross origin access to *.{$NM_DOMAIN}
  6. Access-Control-Allow-Origin *.{$NM_DOMAIN}
  7. # Enable HTTP Strict Transport Security (HSTS)
  8. Strict-Transport-Security "max-age=31536000;"
  9. # Enable cross-site filter (XSS) and tell browser to block detected attacks
  10. X-XSS-Protection "1; mode=block"
  11. # Disallow the site to be rendered within a frame on a foreign domain (clickjacking protection)
  12. X-Frame-Options "SAMEORIGIN"
  13. # Prevent search engines from indexing
  14. X-Robots-Tag "none"
  15. # Remove the server name
  16. -Server
  17. }
  18. reverse_proxy http://netmaker-ui
  19. }
  20. # API
  21. https://api.{$NM_DOMAIN} {
  22. reverse_proxy http://netmaker:8081
  23. }
  24. # MQ
  25. broker.{$NM_DOMAIN} {
  26. @ws {
  27. header Connection *Upgrade*
  28. header Upgrade websocket
  29. }
  30. reverse_proxy @ws mq:8883 # For EMQX websockets use `reverse_proxy @ws mq:8083`
  31. }