Matrix Docker Ansible eploy
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 

147 linhas
5.3 KiB

  1. # This is a sample file demonstrating how to set up reverse-proxy for matrix.DOMAIN
  2. <VirtualHost *:80>
  3. ServerName matrix.DOMAIN
  4. ProxyVia On
  5. # Map /.well-known/acme-challenge to the certbot server
  6. # If you manage SSL certificates by yourself, this will differ.
  7. <Location /.well-known/acme-challenge>
  8. ProxyPreserveHost On
  9. ProxyPass http://127.0.0.1:2402/.well-known/acme-challenge
  10. </Location>
  11. Redirect permanent / https://matrix.DOMAIN/
  12. </VirtualHost>
  13. # Client-Server API
  14. <VirtualHost *:443>
  15. ServerName matrix.DOMAIN
  16. SSLEngine On
  17. # If you manage SSL certificates by yourself, these paths will differ.
  18. SSLCertificateFile /matrix/ssl/config/live/matrix.DOMAIN/fullchain.pem
  19. SSLCertificateKeyFile /matrix/ssl/config/live/matrix.DOMAIN/privkey.pem
  20. SSLProxyEngine on
  21. SSLProxyProtocol +TLSv1.2 +TLSv1.3
  22. SSLCipherSuite EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH
  23. ProxyPreserveHost On
  24. ProxyRequests Off
  25. ProxyVia On
  26. RequestHeader set "X-Forwarded-Proto" expr=%{REQUEST_SCHEME}
  27. # Keep some URIs free for different proxy/location
  28. ProxyPassMatch ^/.well-known/matrix/client !
  29. ProxyPassMatch ^/.well-known/matrix/server !
  30. ProxyPassMatch ^/.well-known/matrix/support !
  31. ProxyPassMatch ^/_matrix/identity !
  32. ProxyPassMatch ^/_matrix/client/r0/user_directory/search !
  33. # Proxy all remaining traffic to Synapse
  34. AllowEncodedSlashes NoDecode
  35. ProxyPass /_matrix http://127.0.0.1:8008/_matrix retry=0 nocanon
  36. ProxyPassReverse /_matrix http://127.0.0.1:8008/_matrix
  37. ProxyPass /_synapse/client http://127.0.0.1:8008/_synapse/client retry=0 nocanon
  38. ProxyPassReverse /_synapse/client http://127.0.0.1:8008/_synapse/client
  39. # Proxy Admin API (necessary for Synapse-Admin)
  40. # ProxyPass /_synapse/admin http://127.0.0.1:8008/_synapse/admin retry=0 nocanon
  41. # ProxyPassReverse /_synapse/admin http://127.0.0.1:8008/_synapse/admin
  42. # Proxy Synapse-Admin
  43. # ProxyPass /synapse-admin http://127.0.0.1:8766 retry=0 nocanon
  44. # ProxyPassReverse /synapse-admin http://127.0.0.1:8766
  45. # Map /.well-known/matrix/client for client discovery
  46. Alias /.well-known/matrix/client /matrix/static-files/.well-known/matrix/client
  47. <Files "/matrix/static-files/.well-known/matrix/client">
  48. Require all granted
  49. </Files>
  50. <Location "/.well-known/matrix/client">
  51. Header always set Content-Type "application/json"
  52. Header always set Access-Control-Allow-Origin "*"
  53. </Location>
  54. # Map /.well-known/matrix/server for server discovery
  55. Alias /.well-known/matrix/server /matrix/static-files/.well-known/matrix/server
  56. <Files "/matrix/static-files/.well-known/matrix/server">
  57. Require all granted
  58. </Files>
  59. <Location "/.well-known/matrix/server">
  60. Header always set Content-Type "application/json"
  61. </Location>
  62. # Map /.well-known/matrix/support for support discovery
  63. Alias /.well-known/matrix/support /matrix/static-files/.well-known/matrix/support
  64. <Files "/matrix/static-files/.well-known/matrix/support">
  65. Require all granted
  66. </Files>
  67. <Location "/.well-known/matrix/support">
  68. Header always set Content-Type "application/json"
  69. </Location>
  70. <Directory /matrix/static-files/.well-known/matrix/>
  71. AllowOverride All
  72. # Apache 2.4:
  73. Require all granted
  74. # Or for Apache 2.2:
  75. #order allow,deny
  76. </Directory>
  77. # Map /_matrix/identity to the identity server
  78. <Location /_matrix/identity>
  79. ProxyPass http://127.0.0.1:8090/_matrix/identity nocanon
  80. </Location>
  81. # Map /_matrix/client/r0/user_directory/search to the identity server
  82. <Location /_matrix/client/r0/user_directory/search>
  83. ProxyPass http://127.0.0.1:8090/_matrix/client/r0/user_directory/search nocanon
  84. </Location>
  85. ErrorLog ${APACHE_LOG_DIR}/matrix.DOMAIN-error.log
  86. CustomLog ${APACHE_LOG_DIR}/matrix.DOMAIN-access.log combined
  87. </VirtualHost>
  88. # Server-Server (federation) API
  89. # Use this apache reverse proxy template to enable matrix server-to-server federation traffic
  90. # Be sure that network traffic on port 8448 is possible
  91. #
  92. # You can check your federation config at https://federationtester.matrix.org/
  93. # Enter there your base DOMAIN address, NOT your matrix.DOMAIN address, ex. https://DOMAIN
  94. #
  95. # In this example we use all services on the same machine (127.0.0.1) but you can do this with different machines.
  96. # If you do so be sure to reach the destinated IPADRESS and the correspondending port. Check this with netstat, nmap or your favourite tool.
  97. Listen 8448
  98. <VirtualHost *:8448>
  99. ServerName matrix.DOMAIN
  100. SSLEngine On
  101. # If you manage SSL certificates by yourself, these paths will differ.
  102. SSLCertificateFile /matrix/ssl/config/live/matrix.DOMAIN/fullchain.pem
  103. SSLCertificateKeyFile /matrix/ssl/config/live/matrix.DOMAIN/privkey.pem
  104. SSLProxyEngine on
  105. SSLProxyProtocol +TLSv1.2 +TLSv1.3
  106. SSLCipherSuite EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH
  107. ProxyPreserveHost On
  108. ProxyRequests Off
  109. ProxyVia On
  110. RequestHeader set "X-Forwarded-Proto" expr=%{REQUEST_SCHEME}
  111. # Proxy all remaining traffic to the Synapse port
  112. # Beware: In this example the local traffic goes to the local synapse server at 127.0.0.1
  113. # Of course you can use another IPADRESS in case of using other synapse servers in your network
  114. AllowEncodedSlashes NoDecode
  115. ProxyPass /_matrix http://127.0.0.1:8048/_matrix retry=0 nocanon
  116. ProxyPassReverse /_matrix http://127.0.0.1:8048/_matrix
  117. ErrorLog ${APACHE_LOG_DIR}/matrix.DOMAIN-error.log
  118. CustomLog ${APACHE_LOG_DIR}/matrix.DOMAIN-access.log combined
  119. </VirtualHost>