Matrix Docker Ansible eploy
25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.
 
 

113 satır
3.4 KiB

  1. server {
  2. listen 80;
  3. server_name {{ matrix_nginx_proxy_proxy_matrix_hostname }};
  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_lets_encrypt_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 {{ matrix_nginx_proxy_proxy_matrix_hostname }};
  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/{{ matrix_nginx_proxy_proxy_matrix_hostname }}/fullchain.pem;
  29. ssl_certificate_key {{ matrix_ssl_config_dir_path }}/live/{{ matrix_nginx_proxy_proxy_matrix_hostname }}/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. add_header Access-Control-Allow-Origin *;
  38. }
  39. {% if matrix_corporal_enabled and matrix_corporal_http_api_enabled %}
  40. location /_matrix/corporal {
  41. {% if matrix_nginx_proxy_enabled %}
  42. {# Use the embedded DNS resolver in Docker containers to discover the service #}
  43. resolver 127.0.0.11 valid=5s;
  44. set $backend "matrix-corporal:41081";
  45. proxy_pass http://$backend;
  46. {% else %}
  47. {# Generic configuration for use outside of our container setup #}
  48. proxy_pass http://localhost:41081;
  49. {% endif %}
  50. }
  51. {% endif %}
  52. {% if matrix_mxisd_enabled %}
  53. location /_matrix/identity {
  54. {% if matrix_nginx_proxy_enabled %}
  55. {# Use the embedded DNS resolver in Docker containers to discover the service #}
  56. resolver 127.0.0.11 valid=5s;
  57. set $backend "matrix-mxisd:8090";
  58. proxy_pass http://$backend;
  59. {% else %}
  60. {# Generic configuration for use outside of our container setup #}
  61. proxy_pass http://localhost:8090;
  62. {% endif %}
  63. }
  64. {% endif %}
  65. {% if matrix_mautrix_telegram_enabled %}
  66. location {{ matrix_mautrix_telegram_public_endpoint }} {
  67. {% if matrix_nginx_proxy_enabled %}
  68. {# Use the embedded DNS resolver in Docker containers to discover the service #}
  69. resolver 127.0.0.11 valid=5s;
  70. set $backend "matrix-mautrix-telegram:8080";
  71. proxy_pass http://$backend;
  72. {% else %}
  73. {# Generic configuration for use outside of our container setup #}
  74. proxy_pass http://localhost:8080;
  75. {% endif %}
  76. }
  77. {% endif %}
  78. location /_matrix {
  79. {% if matrix_nginx_proxy_enabled %}
  80. {# Use the embedded DNS resolver in Docker containers to discover the service #}
  81. resolver 127.0.0.11 valid=5s;
  82. set $backend "{{ matrix_nginx_proxy_matrix_client_api_addr_with_proxy_container }}";
  83. proxy_pass http://$backend;
  84. {% else %}
  85. {# Generic configuration for use outside of our container setup #}
  86. proxy_pass http://{{ matrix_nginx_proxy_matrix_client_api_addr_sans_proxy_container }};
  87. {% endif %}
  88. proxy_set_header X-Forwarded-For $remote_addr;
  89. client_body_buffer_size 25M;
  90. client_max_body_size {{ matrix_synapse_max_upload_size_mb }}M;
  91. proxy_max_temp_file_size 0;
  92. }
  93. location / {
  94. rewrite ^/$ /_matrix/static/ last;
  95. }
  96. }