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.
 
 

168 satır
5.5 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. {% if matrix_nginx_proxy_hsts_preload_enabled %}
  6. add_header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload" always;
  7. {% else %}
  8. add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
  9. {% endif %}
  10. add_header X-XSS-Protection "{{ matrix_nginx_proxy_xss_protection }}";
  11. add_header X-Content-Type-Options nosniff;
  12. {% if matrix_nginx_proxy_floc_optout_enabled %}
  13. add_header Permissions-Policy interest-cohort=() always;
  14. {% endif %}
  15. {% for configuration_block in matrix_nginx_proxy_proxy_jitsi_additional_server_configuration_blocks %}
  16. {{- configuration_block }}
  17. {% endfor %}
  18. {% if matrix_nginx_proxy_proxy_jitsi_manage_wellknown %}
  19. location /.well-known {
  20. root {{ matrix_static_files_base_path }};
  21. expires 4h;
  22. default_type application/json;
  23. add_header Access-Control-Allow-Origin *;
  24. }
  25. {% endif %}
  26. location / {
  27. {% if matrix_nginx_proxy_enabled %}
  28. {# Use the embedded DNS resolver in Docker containers to discover the service #}
  29. resolver {{ matrix_nginx_proxy_http_level_resolver }} valid=5s;
  30. set $backend "matrix-jitsi-web:80";
  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:13080;
  35. {% endif %}
  36. proxy_set_header Host $host;
  37. proxy_set_header X-Forwarded-For {{ matrix_nginx_proxy_x_forwarded_for }};
  38. }
  39. # colibri (JVB) websockets
  40. location ~ ^/colibri-ws/jvb-1/(.*) {
  41. {% if matrix_nginx_proxy_enabled %}
  42. resolver {{ matrix_nginx_proxy_http_level_resolver }} valid=5s;
  43. set $backend "matrix-jitsi-jvb:9090";
  44. proxy_pass http://$backend;
  45. {% else %}
  46. {# Generic configuration for use outside of our container setup #}
  47. proxy_pass http://127.0.0.1:13090;
  48. {% endif %}
  49. proxy_set_header Host $host;
  50. proxy_set_header X-Forwarded-For {{ matrix_nginx_proxy_x_forwarded_for }};
  51. proxy_set_header Upgrade $http_upgrade;
  52. proxy_set_header Connection "upgrade";
  53. proxy_http_version 1.1;
  54. tcp_nodelay on;
  55. }
  56. {% for id, ip_address in matrix_nginx_proxy_proxy_jitsi_additional_jvbs.items() %}
  57. # colibri (JVB) websockets for additional JVBs
  58. location ~ ^/colibri-ws/{{ id | regex_escape }}/(.*) {
  59. proxy_pass http://{{ ip_address }}:9090/colibri-ws/{{ id }}/$1$is_args$args;
  60. proxy_set_header Host $host;
  61. proxy_set_header X-Forwarded-For {{ matrix_nginx_proxy_x_forwarded_for }};
  62. proxy_set_header Upgrade $http_upgrade;
  63. proxy_set_header Connection "upgrade";
  64. proxy_http_version 1.1;
  65. tcp_nodelay on;
  66. }
  67. {% endfor %}
  68. # XMPP websocket
  69. location = /xmpp-websocket {
  70. {% if matrix_nginx_proxy_enabled %}
  71. resolver {{ matrix_nginx_proxy_http_level_resolver }} valid=5s;
  72. set $backend {{ matrix_jitsi_xmpp_bosh_url_base }};
  73. proxy_pass $backend$request_uri;
  74. {% else %}
  75. {# Generic configuration for use outside of our container setup #}
  76. proxy_pass http://127.0.0.1:5280;
  77. {% endif %}
  78. proxy_set_header Host $host;
  79. proxy_http_version 1.1;
  80. proxy_read_timeout 900s;
  81. proxy_set_header Connection "upgrade";
  82. proxy_set_header Upgrade $http_upgrade;
  83. proxy_set_header X-Forwarded-For {{ matrix_nginx_proxy_x_forwarded_for }};
  84. proxy_set_header X-Forwarded-Proto {{ matrix_nginx_proxy_x_forwarded_proto_value }};
  85. tcp_nodelay on;
  86. }
  87. {% endmacro %}
  88. server {
  89. listen {{ 8080 if matrix_nginx_proxy_enabled else 80 }};
  90. listen [::]:{{ 8080 if matrix_nginx_proxy_enabled else 80 }};
  91. server_name {{ matrix_nginx_proxy_proxy_jitsi_hostname }};
  92. server_tokens off;
  93. root /dev/null;
  94. {% if matrix_nginx_proxy_https_enabled %}
  95. location /.well-known/acme-challenge {
  96. {% if matrix_nginx_proxy_enabled %}
  97. {# Use the embedded DNS resolver in Docker containers to discover the service #}
  98. resolver {{ matrix_nginx_proxy_http_level_resolver }} valid=5s;
  99. set $backend "matrix-certbot:8080";
  100. proxy_pass http://$backend;
  101. {% else %}
  102. {# Generic configuration for use outside of our container setup #}
  103. proxy_pass http://127.0.0.1:{{ matrix_ssl_lets_encrypt_certbot_standalone_http_port }};
  104. {% endif %}
  105. }
  106. location / {
  107. return 301 https://$http_host$request_uri;
  108. }
  109. {% else %}
  110. {{ render_vhost_directives() }}
  111. {% endif %}
  112. }
  113. {% if matrix_nginx_proxy_https_enabled %}
  114. server {
  115. listen {{ 8443 if matrix_nginx_proxy_enabled else 443 }} ssl http2;
  116. listen [::]:{{ 8443 if matrix_nginx_proxy_enabled else 443 }} ssl http2;
  117. server_name {{ matrix_nginx_proxy_proxy_jitsi_hostname }};
  118. server_tokens off;
  119. root /dev/null;
  120. ssl_certificate {{ matrix_ssl_config_dir_path }}/live/{{ matrix_nginx_proxy_proxy_jitsi_hostname }}/fullchain.pem;
  121. ssl_certificate_key {{ matrix_ssl_config_dir_path }}/live/{{ matrix_nginx_proxy_proxy_jitsi_hostname }}/privkey.pem;
  122. ssl_protocols {{ matrix_nginx_proxy_ssl_protocols }};
  123. {% if matrix_nginx_proxy_ssl_ciphers != '' %}
  124. ssl_ciphers {{ matrix_nginx_proxy_ssl_ciphers }};
  125. {% endif %}
  126. ssl_prefer_server_ciphers {{ matrix_nginx_proxy_ssl_prefer_server_ciphers }};
  127. {% if matrix_nginx_proxy_ocsp_stapling_enabled %}
  128. ssl_stapling on;
  129. ssl_stapling_verify on;
  130. ssl_trusted_certificate {{ matrix_ssl_config_dir_path }}/live/{{ matrix_nginx_proxy_proxy_jitsi_hostname }}/chain.pem;
  131. {% endif %}
  132. {% if matrix_nginx_proxy_ssl_session_tickets_off %}
  133. ssl_session_tickets off;
  134. {% endif %}
  135. ssl_session_cache {{ matrix_nginx_proxy_ssl_session_cache }};
  136. ssl_session_timeout {{ matrix_nginx_proxy_ssl_session_timeout }};
  137. {{ render_vhost_directives() }}
  138. }
  139. {% endif %}