Matrix Docker Ansible eploy
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

156 строки
5.2 KiB

  1. matrix.DOMAIN.tld {
  2. tls {$CADDY_TLS}
  3. @identity {
  4. path /_matrix/identity/*
  5. }
  6. @noidentity {
  7. not path /_matrix/identity/*
  8. }
  9. @search {
  10. path /_matrix/client/r0/user_directory/search/*
  11. }
  12. @nosearch {
  13. not path /_matrix/client/r0/user_directory/search/*
  14. }
  15. @static {
  16. path /matrix/static-files/*
  17. }
  18. @nostatic {
  19. not path /matrix/static-files/*
  20. }
  21. header {
  22. # Enable HTTP Strict Transport Security (HSTS) to force clients to always connect via HTTPS
  23. Strict-Transport-Security "max-age=31536000; includeSubDomains; preload"
  24. # Enable cross-site filter (XSS) and tell browser to block detected attacks
  25. X-XSS-Protection "1; mode=block"
  26. # Prevent some browsers from MIME-sniffing a response away from the declared Content-Type
  27. X-Content-Type-Options "nosniff"
  28. # Disallow the site to be rendered within a frame (clickjacking protection)
  29. X-Frame-Options "DENY"
  30. # X-Robots-Tag
  31. X-Robots-Tag "noindex, noarchive, nofollow"
  32. 167,9 79%
  33. }
  34. # Cache
  35. header @static {
  36. # Cache
  37. Cache-Control "public, max-age=31536000"
  38. defer
  39. }
  40. # identity
  41. handle @identity {
  42. reverse_proxy localhost:8090 {
  43. header_up X-Forwarded-Port {http.request.port}
  44. header_up X-Forwarded-Proto {http.request.scheme}
  45. header_up X-Forwarded-TlsProto {tls_protocol}
  46. header_up X-Forwarded-TlsCipher {tls_cipher}
  47. header_up X-Forwarded-HttpsProto {proto}
  48. }
  49. }
  50. # search
  51. handle @search {
  52. reverse_proxy localhost:8090 {
  53. header_up X-Forwarded-Port {http.request.port}
  54. header_up X-Forwarded-Proto {http.request.scheme}
  55. header_up X-Forwarded-TlsProto {tls_protocol}
  56. header_up X-Forwarded-TlsCipher {tls_cipher}
  57. header_up X-Forwarded-HttpsProto {proto}
  58. }
  59. }
  60. handle {
  61. encode zstd gzip
  62. reverse_proxy localhost:8008 {
  63. header_up X-Forwarded-Port {http.request.port}
  64. header_up X-Forwarded-Proto {http.request.scheme}
  65. header_up X-Forwarded-TlsProto {tls_protocol}
  66. header_up X-Forwarded-TlsCipher {tls_cipher}
  67. header_up X-Forwarded-HttpsProto {proto}
  68. }
  69. }
  70. }
  71. matrix.DOMAIN.tld:8448 {
  72. handle {
  73. encode zstd gzip
  74. reverse_proxy 127.0.0.1:8048 {
  75. header_up X-Forwarded-Port {http.request.port}
  76. header_up X-Forwarded-Proto {http.request.scheme}
  77. header_up X-Forwarded-TlsProto {tls_protocol}
  78. header_up X-Forwarded-TlsCipher {tls_cipher}
  79. header_up X-Forwarded-HttpsProto {proto}
  80. }
  81. }
  82. }
  83. dimension.DOMAIN.tld {
  84. tls {$CADDY_TLS}
  85. header {
  86. # Enable HTTP Strict Transport Security (HSTS) to force clients to always connect via HTTPS
  87. Strict-Transport-Security "max-age=31536000; includeSubDomains; preload"
  88. # Enable cross-site filter (XSS) and tell browser to block detected attacks
  89. X-XSS-Protection "1; mode=block"
  90. # Prevent some browsers from MIME-sniffing a response away from the declared Content-Type
  91. X-Content-Type-Options "nosniff"
  92. # Disallow the site to be rendered within a frame (clickjacking protection)
  93. X-Frame-Options "DENY"
  94. # X-Robots-Tag
  95. X-Robots-Tag "noindex, noarchive, nofollow"
  96. }
  97. handle {
  98. encode zstd gzip
  99. reverse_proxy localhost:8184 {
  100. header_up X-Forwarded-Port {http.request.port}
  101. header_up X-Forwarded-Proto {http.request.scheme}
  102. header_up X-Forwarded-TlsProto {tls_protocol}
  103. header_up X-Forwarded-TlsCipher {tls_cipher}
  104. header_up X-Forwarded-HttpsProto {proto}
  105. }
  106. }
  107. }
  108. element.DOMAIN.tld {
  109. tls {$CADDY_TLS}
  110. header {
  111. # Enable HTTP Strict Transport Security (HSTS) to force clients to always connect via HTTPS
  112. Strict-Transport-Security "max-age=31536000; includeSubDomains; preload"
  113. # Enable cross-site filter (XSS) and tell browser to block detected attacks
  114. X-XSS-Protection "1; mode=block"
  115. # Prevent some browsers from MIME-sniffing a response away from the declared Content-Type
  116. X-Content-Type-Options "nosniff"
  117. # Disallow the site to be rendered within a frame (clickjacking protection)
  118. X-Frame-Options "DENY"
  119. # X-Robots-Tag
  120. X-Robots-Tag "noindex, noarchive, nofollow"
  121. }
  122. handle {
  123. encode zstd gzip
  124. reverse_proxy localhost:8765 {
  125. header_up X-Forwarded-Port {http.request.port}
  126. header_up X-Forwarded-Proto {http.request.scheme}
  127. header_up X-Forwarded-TlsProto {tls_protocol}
  128. header_up X-Forwarded-TlsCipher {tls_cipher}
  129. header_up X-Forwarded-HttpsProto {proto}
  130. }
  131. }