Matrix Docker Ansible eploy
Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.
 
 

97 wiersze
3.6 KiB

  1. global
  2. log /dev/log local0
  3. log /dev/log local1 notice
  4. chroot /var/lib/haproxy
  5. stats socket /run/haproxy/admin.sock mode 660 level admin
  6. stats timeout 30s
  7. user haproxy
  8. group haproxy
  9. daemon
  10. # Default SSL material locations
  11. ca-base /etc/ssl/certs
  12. crt-base /etc/ssl/private
  13. # Default ciphers to use on SSL-enabled listening sockets.
  14. # For more information, see ciphers(1SSL). This list is from:
  15. # https://hynek.me/articles/hardening-your-web-servers-ssl-ciphers/
  16. ssl-default-bind-ciphers ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:ECDH+3DES:DH+3DES:RSA+AESGCM:RSA+AES:RSA+3DES:!aNULL:!MD5:!DSS
  17. ssl-default-bind-options no-sslv3
  18. defaults
  19. log global
  20. mode http
  21. option httplog
  22. option dontlognull
  23. option forwardfor
  24. option redispatch
  25. timeout connect 5000
  26. timeout client 50000
  27. timeout server 50000
  28. errorfile 400 /etc/haproxy/errors/400.http
  29. errorfile 403 /etc/haproxy/errors/403.http
  30. errorfile 408 /etc/haproxy/errors/408.http
  31. errorfile 500 /etc/haproxy/errors/500.http
  32. errorfile 502 /etc/haproxy/errors/502.http
  33. errorfile 503 /etc/haproxy/errors/503.http
  34. errorfile 504 /etc/haproxy/errors/504.http
  35. frontend https-frontend
  36. bind *:80
  37. # HAproxy wants the full chain and the private key in one file. For Letsencrypt manually generated certs (e.g., wildcard certs) you can use
  38. # cat /etc/letsencrypt/live/example.com/fullchain.pem /etc/letsencrypt/live/example.com/privkey.pem > /etc/haproxy/certs/star-example.com.pem
  39. bind *:443 ssl crt /etc/haproxy/certs/star-example.com.pem
  40. reqadd X-Forwarded-Proto:\ https
  41. option httplog
  42. option http-server-close
  43. #
  44. # Matrix
  45. #
  46. # matrix.example.com
  47. acl matrix_domain hdr_dom(host) -i matrix.example.com
  48. acl static_files path -i -m beg /.well-known/matrix
  49. use_backend nginx-static if static_files
  50. # /_matrix/identity and /_matrix/client/r0/user_directory/search
  51. acl matrix_identity path -i -m beg /_matrix/identity
  52. acl matrix_search path -i -m beg /_matrix/client/r0/user_directory/search
  53. # Send to :8090
  54. use_backend matrix-supporting if matrix_identity or matrix_search
  55. # /_matrix and /_synapse/admin
  56. acl matrix_path path -i -m beg /_matrix
  57. acl synapse_admin path -i -m beg /_synapse/admin
  58. # Send to :8008
  59. use_backend matrix-main if matrix_path or synapse_admin
  60. # riot.example.com
  61. acl riot_domain hdr_dom(host) -i riot.example.com
  62. # Send to 8765
  63. use_backend riot if riot_domain
  64. # If nothing else match, just send to default matrix backend
  65. use_backend matrix-main if matrix_domain
  66. #default_backend matrix-main
  67. frontend matrix-federation
  68. bind *:8448 ssl crt /etc/haproxy/certs/star-example.com.pem
  69. reqadd X-Forwarded-Proto:\ https
  70. option httplog
  71. option http-server-close
  72. default_backend synapse
  73. backend matrix-supporting
  74. server matrix-supporting 127.0.0.1:8090 check
  75. backend matrix-main
  76. server matrix-main 127.0.0.1:8008 check
  77. backend synapse
  78. server synapse 127.0.0.1:8048 check
  79. backend nginx-static
  80. capture request header origin len 128
  81. http-response add-header Access-Control-Allow-Origin *
  82. rspadd Access-Control-Allow-Methods:\ GET,\ HEAD,\ OPTIONS,\ POST,\ PUT if { capture.req.hdr(0) -m found }
  83. rspadd Access-Control-Allow-Credentials:\ true if { capture.req.hdr(0) -m found }
  84. rspadd Access-Control-Allow-Headers:\ Origin,\ Accept,\ X-Requested-With,\ Content-Type,\ Access-Control-Request-Method,\ Access-Control-Request-Headers,\ Authorization if { capture.req.hdr(0) -m found }
  85. server nginx 127.0.0.1:40888 check
  86. backend riot
  87. server riot 127.0.0.1:8765 check