Matrix Docker Ansible eploy
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
 
 

108 lignes
3.2 KiB

  1. server {
  2. listen 80;
  3. server_name {{ hostname_matrix }};
  4. server_tokens off;
  5. location /.well-known/acme-challenge {
  6. {% if matrix_nginx_proxy_enabled %}
  7. {# Use the embedded DNS resolver in Docker containers to discover the service #}
  8. resolver 127.0.0.11 valid=5s;
  9. set $backend "matrix-certbot:80";
  10. proxy_pass http://$backend;
  11. {% else %}
  12. {# Generic configuration for use outside of our container setup #}
  13. proxy_pass http://localhost:{{ matrix_ssl_certbot_standalone_http_port }};
  14. {% endif %}
  15. }
  16. location / {
  17. return 301 https://$http_host$request_uri;
  18. }
  19. }
  20. server {
  21. listen 443 ssl http2;
  22. listen [::]:443 ssl http2;
  23. server_name {{ hostname_matrix }};
  24. server_tokens off;
  25. root /dev/null;
  26. gzip on;
  27. gzip_types text/plain application/json;
  28. ssl_certificate {{ matrix_ssl_config_dir_path }}/live/{{ hostname_matrix }}/fullchain.pem;
  29. ssl_certificate_key {{ matrix_ssl_config_dir_path }}/live/{{ hostname_matrix }}/privkey.pem;
  30. ssl_protocols {{ matrix_nginx_proxy_ssl_protocols }};
  31. ssl_prefer_server_ciphers on;
  32. ssl_ciphers "EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH";
  33. location /.well-known/matrix/client {
  34. root {{ matrix_static_files_base_path }};
  35. expires 1m;
  36. default_type application/json;
  37. }
  38. {% if matrix_corporal_enabled and matrix_corporal_http_api_enabled %}
  39. location /_matrix/corporal {
  40. {% if matrix_nginx_proxy_enabled %}
  41. {# Use the embedded DNS resolver in Docker containers to discover the service #}
  42. resolver 127.0.0.11 valid=5s;
  43. set $backend "matrix-corporal:41081";
  44. proxy_pass http://$backend;
  45. {% else %}
  46. {# Generic configuration for use outside of our container setup #}
  47. proxy_pass http://localhost:41081;
  48. {% endif %}
  49. }
  50. {% endif %}
  51. {% if matrix_mxisd_enabled %}
  52. location /_matrix/identity {
  53. {% if matrix_nginx_proxy_enabled %}
  54. {# Use the embedded DNS resolver in Docker containers to discover the service #}
  55. resolver 127.0.0.11 valid=5s;
  56. set $backend "matrix-mxisd:8090";
  57. proxy_pass http://$backend;
  58. {% else %}
  59. {# Generic configuration for use outside of our container setup #}
  60. proxy_pass http://localhost:8090;
  61. {% endif %}
  62. }
  63. {% endif %}
  64. {% if matrix_mautrix_telegram_enabled %}
  65. location {{ matrix_mautrix_telegram_public_endpoint }} {
  66. {% if matrix_nginx_proxy_enabled %}
  67. {# Use the embedded DNS resolver in Docker containers to discover the service #}
  68. resolver 127.0.0.11 valid=5s;
  69. set $backend "matrix-mautrix-telegram:8080";
  70. proxy_pass http://$backend;
  71. {% else %}
  72. {# Generic configuration for use outside of our container setup #}
  73. proxy_pass http://localhost:8080;
  74. {% endif %}
  75. }
  76. {% endif %}
  77. location /_matrix {
  78. {% if matrix_nginx_proxy_enabled %}
  79. {# Use the embedded DNS resolver in Docker containers to discover the service #}
  80. resolver 127.0.0.11 valid=5s;
  81. set $backend "{{ matrix_nginx_proxy_matrix_client_api_addr_with_proxy_container }}";
  82. proxy_pass http://$backend;
  83. {% else %}
  84. {# Generic configuration for use outside of our container setup #}
  85. proxy_pass http://{{ matrix_nginx_proxy_matrix_client_api_addr_sans_proxy_container }};
  86. {% endif %}
  87. proxy_set_header X-Forwarded-For $remote_addr;
  88. client_body_buffer_size 25M;
  89. client_max_body_size {{ matrix_synapse_max_upload_size_mb }}M;
  90. proxy_max_temp_file_size 0;
  91. }
  92. }