Matrix Docker Ansible eploy
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.
 
 
 

137 строки
4.2 KiB

  1. #jinja2: lstrip_blocks: "True"
  2. {% macro render_vhost_directives() %}
  3. gzip on;
  4. gzip_types text/plain application/json application/javascript text/css image/x-icon font/ttf image/gif;
  5. add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
  6. add_header X-Content-Type-Options nosniff;
  7. {% if matrix_nginx_proxy_floc_optout_enabled %}
  8. add_header Permissions-Policy interest-cohort=() always;
  9. {% endif %}
  10. {% for configuration_block in matrix_nginx_proxy_proxy_jitsi_additional_server_configuration_blocks %}
  11. {{- configuration_block }}
  12. {% endfor %}
  13. location / {
  14. {% if matrix_nginx_proxy_enabled %}
  15. {# Use the embedded DNS resolver in Docker containers to discover the service #}
  16. resolver 127.0.0.11 valid=5s;
  17. set $backend "matrix-jitsi-web:80";
  18. proxy_pass http://$backend;
  19. {% else %}
  20. {# Generic configuration for use outside of our container setup #}
  21. proxy_pass http://127.0.0.1:13080;
  22. {% endif %}
  23. proxy_set_header Host $host;
  24. proxy_set_header X-Forwarded-For $remote_addr;
  25. }
  26. # colibri (JVB) websockets
  27. location ~ ^/colibri-ws/([a-zA-Z0-9-\.]+)/(.*) {
  28. {% if matrix_nginx_proxy_enabled %}
  29. resolver 127.0.0.11 valid=5s;
  30. set $backend "matrix-jitsi-jvb:9090";
  31. proxy_pass http://$backend;
  32. {% else %}
  33. {# Generic configuration for use outside of our container setup #}
  34. proxy_pass http://127.0.0.1:13090;
  35. {% endif %}
  36. proxy_set_header Host $host;
  37. proxy_set_header X-Forwarded-For $remote_addr;
  38. proxy_set_header Upgrade $http_upgrade;
  39. proxy_set_header Connection "upgrade";
  40. proxy_http_version 1.1;
  41. tcp_nodelay on;
  42. }
  43. # XMPP websocket
  44. location = /xmpp-websocket {
  45. {% if matrix_nginx_proxy_enabled %}
  46. resolver 127.0.0.11 valid=5s;
  47. set $backend {{ matrix_jitsi_xmpp_bosh_url_base }};
  48. proxy_pass $backend/xmpp-websocket;
  49. {% else %}
  50. {# Generic configuration for use outside of our container setup #}
  51. proxy_pass http://127.0.0.1:5280;
  52. {% endif %}
  53. proxy_set_header Host $host;
  54. proxy_http_version 1.1;
  55. proxy_read_timeout 900s;
  56. proxy_set_header Connection "upgrade";
  57. proxy_set_header Upgrade $http_upgrade;
  58. proxy_set_header X-Forwarded-For $remote_addr;
  59. proxy_set_header X-Forwarded-Proto $scheme;
  60. tcp_nodelay on;
  61. }
  62. {% endmacro %}
  63. server {
  64. listen {{ 8080 if matrix_nginx_proxy_enabled else 80 }};
  65. server_name {{ matrix_nginx_proxy_proxy_jitsi_hostname }};
  66. server_tokens off;
  67. root /dev/null;
  68. {% if matrix_nginx_proxy_https_enabled %}
  69. location /.well-known/acme-challenge {
  70. {% if matrix_nginx_proxy_enabled %}
  71. {# Use the embedded DNS resolver in Docker containers to discover the service #}
  72. resolver 127.0.0.11 valid=5s;
  73. set $backend "matrix-certbot:8080";
  74. proxy_pass http://$backend;
  75. {% else %}
  76. {# Generic configuration for use outside of our container setup #}
  77. proxy_pass http://127.0.0.1:{{ matrix_ssl_lets_encrypt_certbot_standalone_http_port }};
  78. {% endif %}
  79. }
  80. location / {
  81. return 301 https://$http_host$request_uri;
  82. }
  83. {% else %}
  84. {{ render_vhost_directives() }}
  85. {% endif %}
  86. }
  87. {% if matrix_nginx_proxy_https_enabled %}
  88. server {
  89. listen {{ 8443 if matrix_nginx_proxy_enabled else 443 }} ssl http2;
  90. listen [::]:{{ 8443 if matrix_nginx_proxy_enabled else 443 }} ssl http2;
  91. server_name {{ matrix_nginx_proxy_proxy_jitsi_hostname }};
  92. server_tokens off;
  93. root /dev/null;
  94. ssl_certificate {{ matrix_ssl_config_dir_path }}/live/{{ matrix_nginx_proxy_proxy_jitsi_hostname }}/fullchain.pem;
  95. ssl_certificate_key {{ matrix_ssl_config_dir_path }}/live/{{ matrix_nginx_proxy_proxy_jitsi_hostname }}/privkey.pem;
  96. ssl_protocols {{ matrix_nginx_proxy_ssl_protocols }};
  97. {% if matrix_nginx_proxy_ssl_ciphers != '' %}
  98. ssl_ciphers {{ matrix_nginx_proxy_ssl_ciphers }};
  99. {% endif %}
  100. ssl_prefer_server_ciphers {{ matrix_nginx_proxy_ssl_prefer_server_ciphers }};
  101. {% if matrix_nginx_proxy_ocsp_stapling_enabled %}
  102. ssl_stapling on;
  103. ssl_stapling_verify on;
  104. ssl_trusted_certificate {{ matrix_ssl_config_dir_path }}/live/{{ matrix_nginx_proxy_proxy_jitsi_hostname }}/chain.pem;
  105. {% endif %}
  106. {% if matrix_nginx_proxy_ssl_session_tickets_off %}
  107. ssl_session_tickets off;
  108. {% endif %}
  109. ssl_session_cache {{ matrix_nginx_proxy_ssl_session_cache }};
  110. ssl_session_timeout {{ matrix_nginx_proxy_ssl_session_timeout }};
  111. {{ render_vhost_directives() }}
  112. }
  113. {% endif %}