Matrix Docker Ansible eploy
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

235 lines
7.8 KiB

  1. matrix.DOMAIN.tld {
  2. # creates letsencrypt certificate
  3. # tls your@email.com
  4. @identity {
  5. path /_matrix/identity/*
  6. }
  7. @noidentity {
  8. not path /_matrix/identity/*
  9. }
  10. @search {
  11. path /_matrix/client/r0/user_directory/search/*
  12. }
  13. @nosearch {
  14. not path /_matrix/client/r0/user_directory/search/*
  15. }
  16. @static {
  17. path /matrix/static-files/*
  18. }
  19. @nostatic {
  20. not path /matrix/static-files/*
  21. }
  22. @wellknown {
  23. path /.well-known/matrix/*
  24. }
  25. header {
  26. # Enable HTTP Strict Transport Security (HSTS) to force clients to always connect via HTTPS
  27. Strict-Transport-Security "max-age=31536000; includeSubDomains; preload"
  28. # Enable cross-site filter (XSS) and tell browser to block detected attacks
  29. X-XSS-Protection "1; mode=block"
  30. # Prevent some browsers from MIME-sniffing a response away from the declared Content-Type
  31. X-Content-Type-Options "nosniff"
  32. # Disallow the site to be rendered within a frame (clickjacking protection)
  33. X-Frame-Options "DENY"
  34. # X-Robots-Tag
  35. X-Robots-Tag "noindex, noarchive, nofollow"
  36. }
  37. # Cache
  38. header @static {
  39. # Cache
  40. Cache-Control "public, max-age=31536000"
  41. defer
  42. }
  43. # identity
  44. handle @identity {
  45. reverse_proxy localhost:8090 {
  46. header_up X-Forwarded-Port {http.request.port}
  47. header_up X-Forwarded-Proto {http.request.scheme}
  48. header_up X-Forwarded-TlsProto {tls_protocol}
  49. header_up X-Forwarded-TlsCipher {tls_cipher}
  50. header_up X-Forwarded-HttpsProto {proto}
  51. }
  52. }
  53. # search
  54. handle @search {
  55. reverse_proxy localhost:8090 {
  56. header_up X-Forwarded-Port {http.request.port}
  57. header_up X-Forwarded-Proto {http.request.scheme}
  58. header_up X-Forwarded-TlsProto {tls_protocol}
  59. header_up X-Forwarded-TlsCipher {tls_cipher}
  60. header_up X-Forwarded-HttpsProto {proto}
  61. }
  62. }
  63. handle @wellknown {
  64. encode zstd gzip
  65. root * /matrix/static-files
  66. header Cache-Control max-age=14400
  67. header Content-Type application/json
  68. header Access-Control-Allow-Origin *
  69. file_server
  70. }
  71. handle {
  72. encode zstd gzip
  73. reverse_proxy localhost:8008 {
  74. header_up X-Forwarded-Port {http.request.port}
  75. header_up X-Forwarded-Proto {http.request.scheme}
  76. header_up X-Forwarded-TlsProto {tls_protocol}
  77. header_up X-Forwarded-TlsCipher {tls_cipher}
  78. header_up X-Forwarded-HttpsProto {proto}
  79. }
  80. }
  81. }
  82. matrix.DOMAIN.tld:8448 {
  83. handle {
  84. encode zstd gzip
  85. reverse_proxy 127.0.0.1:8048 {
  86. header_up X-Forwarded-Port {http.request.port}
  87. header_up X-Forwarded-Proto {http.request.scheme}
  88. header_up X-Forwarded-TlsProto {tls_protocol}
  89. header_up X-Forwarded-TlsCipher {tls_cipher}
  90. header_up X-Forwarded-HttpsProto {proto}
  91. }
  92. }
  93. }
  94. element.DOMAIN.tld {
  95. # creates letsencrypt certificate
  96. # tls your@email.com
  97. header {
  98. # Enable HTTP Strict Transport Security (HSTS) to force clients to always connect via HTTPS
  99. Strict-Transport-Security "max-age=31536000; includeSubDomains; preload"
  100. # Enable cross-site filter (XSS) and tell browser to block detected attacks
  101. X-XSS-Protection "1; mode=block"
  102. # Prevent some browsers from MIME-sniffing a response away from the declared Content-Type
  103. X-Content-Type-Options "nosniff"
  104. # Disallow the site to be rendered within a frame (clickjacking protection)
  105. X-Frame-Options "DENY"
  106. # X-Robots-Tag
  107. X-Robots-Tag "noindex, noarchive, nofollow"
  108. }
  109. handle {
  110. encode zstd gzip
  111. reverse_proxy localhost:8765 {
  112. header_up X-Forwarded-Port {http.request.port}
  113. header_up X-Forwarded-Proto {http.request.scheme}
  114. header_up X-Forwarded-TlsProto {tls_protocol}
  115. header_up X-Forwarded-TlsCipher {tls_cipher}
  116. header_up X-Forwarded-HttpsProto {proto}
  117. }
  118. }
  119. #dimension.DOMAIN.tld {
  120. #
  121. # # creates letsencrypt certificate
  122. # # tls your@email.com
  123. #
  124. # header {
  125. # # Enable HTTP Strict Transport Security (HSTS) to force clients to always connect via HTTPS
  126. # Strict-Transport-Security "max-age=31536000; includeSubDomains; preload"
  127. # # Enable cross-site filter (XSS) and tell browser to block detected attacks
  128. # X-XSS-Protection "1; mode=block"
  129. # # Prevent some browsers from MIME-sniffing a response away from the declared Content-Type
  130. # X-Content-Type-Options "nosniff"
  131. # # Disallow the site to be rendered within a frame (clickjacking protection)
  132. # X-Frame-Options "DENY"
  133. # # X-Robots-Tag
  134. # X-Robots-Tag "noindex, noarchive, nofollow"
  135. # }
  136. #
  137. # handle {
  138. # encode zstd gzip
  139. #
  140. # reverse_proxy localhost:8184 {
  141. # header_up X-Forwarded-Port {http.request.port}
  142. # header_up X-Forwarded-Proto {http.request.scheme}
  143. # header_up X-Forwarded-TlsProto {tls_protocol}
  144. # header_up X-Forwarded-TlsCipher {tls_cipher}
  145. # header_up X-Forwarded-HttpsProto {proto}
  146. # }
  147. # }
  148. #}
  149. #jitsi.DOMAIN.tld {
  150. #
  151. # creates letsencrypt certificate
  152. # tls your@email.com
  153. #
  154. # header {
  155. # # Enable HTTP Strict Transport Security (HSTS) to force clients to always connect via HTTPS
  156. # Strict-Transport-Security "max-age=31536000; includeSubDomains; preload"
  157. #
  158. # # Enable cross-site filter (XSS) and tell browser to block detected attacks
  159. # X-XSS-Protection "1; mode=block"
  160. #
  161. # # Prevent some browsers from MIME-sniffing a response away from the declared Content-Type
  162. # X-Content-Type-Options "nosniff"
  163. #
  164. # # Disallow the site to be rendered within a frame (clickjacking protection)
  165. # X-Frame-Options "SAMEORIGIN"
  166. #
  167. # # Disable some features
  168. # Feature-Policy "accelerometer 'none';ambient-light-sensor 'none'; autoplay 'none';camera 'none';encrypted-media 'none';focus-without-user-activation 'none'; geolocation 'none';gyroscope #'none';magnetometer 'none';microphone 'none';midi 'none';payment 'none';picture-in-picture 'none'; speaker 'none';sync-xhr 'none';usb 'none';vr 'none'"
  169. #
  170. # # Referer
  171. # Referrer-Policy "no-referrer"
  172. #
  173. # # X-Robots-Tag
  174. # X-Robots-Tag "none"
  175. #
  176. # # Remove Server header
  177. # -Server
  178. # }
  179. #
  180. # handle {
  181. # encode zstd gzip
  182. #
  183. # reverse_proxy 127.0.0.1:13080 {
  184. # header_up X-Forwarded-Port {http.request.port}
  185. # header_up X-Forwarded-Proto {http.request.scheme}
  186. # header_up X-Forwarded-TlsProto {tls_protocol}
  187. # header_up X-Forwarded-TlsCipher {tls_cipher}
  188. # header_up X-Forwarded-HttpsProto {proto}
  189. # }
  190. # }
  191. #}
  192. #DOMAIN.com {
  193. # Uncomment this if you are following "(Option 3): Setting up reverse-proxying of the well-known files from the base domain's server to the Matrix server" of https://github.com/spantaleev/matrix-docker-ansible-deploy/blob/master/docs/configuring-well-known.md#option-3-setting-up-reverse-proxying-of-the-well-known-files-from-the-base-domains-server-to-the-matrix-server
  194. # @wellknown {
  195. # path /.well-known/matrix/*
  196. # }
  197. #
  198. # handle @wellknown {
  199. # reverse_proxy https://matrix.DOMAIN.com {
  200. # header_up Host {http.reverse_proxy.upstream.hostport}
  201. # }
  202. # }
  203. # # Configration for the base domain goes here
  204. # # handle {
  205. # # header -Server
  206. # # encode zstd gzip
  207. # # reverse_proxy localhost:4020
  208. # # }
  209. #}