Matrix Docker Ansible eploy
Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.
 
 

141 Zeilen
4.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. location / {
  19. {% if matrix_nginx_proxy_enabled %}
  20. {# Use the embedded DNS resolver in Docker containers to discover the service #}
  21. resolver 127.0.0.11 valid=5s;
  22. set $backend "matrix-jitsi-web:80";
  23. proxy_pass http://$backend;
  24. {% else %}
  25. {# Generic configuration for use outside of our container setup #}
  26. proxy_pass http://127.0.0.1:13080;
  27. {% endif %}
  28. proxy_set_header Host $host;
  29. proxy_set_header X-Forwarded-For $remote_addr;
  30. }
  31. # colibri (JVB) websockets
  32. location ~ ^/colibri-ws/([a-zA-Z0-9-\.]+)/(.*) {
  33. {% if matrix_nginx_proxy_enabled %}
  34. resolver 127.0.0.11 valid=5s;
  35. set $backend "matrix-jitsi-jvb:9090";
  36. proxy_pass http://$backend;
  37. {% else %}
  38. {# Generic configuration for use outside of our container setup #}
  39. proxy_pass http://127.0.0.1:13090;
  40. {% endif %}
  41. proxy_set_header Host $host;
  42. proxy_set_header X-Forwarded-For $remote_addr;
  43. proxy_set_header Upgrade $http_upgrade;
  44. proxy_set_header Connection "upgrade";
  45. proxy_http_version 1.1;
  46. tcp_nodelay on;
  47. }
  48. # XMPP websocket
  49. location = /xmpp-websocket {
  50. {% if matrix_nginx_proxy_enabled %}
  51. resolver 127.0.0.11 valid=5s;
  52. set $backend {{ matrix_jitsi_xmpp_bosh_url_base }};
  53. proxy_pass $backend/xmpp-websocket;
  54. {% else %}
  55. {# Generic configuration for use outside of our container setup #}
  56. proxy_pass http://127.0.0.1:5280;
  57. {% endif %}
  58. proxy_set_header Host $host;
  59. proxy_http_version 1.1;
  60. proxy_read_timeout 900s;
  61. proxy_set_header Connection "upgrade";
  62. proxy_set_header Upgrade $http_upgrade;
  63. proxy_set_header X-Forwarded-For $remote_addr;
  64. proxy_set_header X-Forwarded-Proto $scheme;
  65. tcp_nodelay on;
  66. }
  67. {% endmacro %}
  68. server {
  69. listen {{ 8080 if matrix_nginx_proxy_enabled else 80 }};
  70. server_name {{ matrix_nginx_proxy_proxy_jitsi_hostname }};
  71. server_tokens off;
  72. root /dev/null;
  73. {% if matrix_nginx_proxy_https_enabled %}
  74. location /.well-known/acme-challenge {
  75. {% if matrix_nginx_proxy_enabled %}
  76. {# Use the embedded DNS resolver in Docker containers to discover the service #}
  77. resolver 127.0.0.11 valid=5s;
  78. set $backend "matrix-certbot:8080";
  79. proxy_pass http://$backend;
  80. {% else %}
  81. {# Generic configuration for use outside of our container setup #}
  82. proxy_pass http://127.0.0.1:{{ matrix_ssl_lets_encrypt_certbot_standalone_http_port }};
  83. {% endif %}
  84. }
  85. location / {
  86. return 301 https://$http_host$request_uri;
  87. }
  88. {% else %}
  89. {{ render_vhost_directives() }}
  90. {% endif %}
  91. }
  92. {% if matrix_nginx_proxy_https_enabled %}
  93. server {
  94. listen {{ 8443 if matrix_nginx_proxy_enabled else 443 }} ssl http2;
  95. listen [::]:{{ 8443 if matrix_nginx_proxy_enabled else 443 }} ssl http2;
  96. server_name {{ matrix_nginx_proxy_proxy_jitsi_hostname }};
  97. server_tokens off;
  98. root /dev/null;
  99. ssl_certificate {{ matrix_ssl_config_dir_path }}/live/{{ matrix_nginx_proxy_proxy_jitsi_hostname }}/fullchain.pem;
  100. ssl_certificate_key {{ matrix_ssl_config_dir_path }}/live/{{ matrix_nginx_proxy_proxy_jitsi_hostname }}/privkey.pem;
  101. ssl_protocols {{ matrix_nginx_proxy_ssl_protocols }};
  102. {% if matrix_nginx_proxy_ssl_ciphers != '' %}
  103. ssl_ciphers {{ matrix_nginx_proxy_ssl_ciphers }};
  104. {% endif %}
  105. ssl_prefer_server_ciphers {{ matrix_nginx_proxy_ssl_prefer_server_ciphers }};
  106. {% if matrix_nginx_proxy_ocsp_stapling_enabled %}
  107. ssl_stapling on;
  108. ssl_stapling_verify on;
  109. ssl_trusted_certificate {{ matrix_ssl_config_dir_path }}/live/{{ matrix_nginx_proxy_proxy_jitsi_hostname }}/chain.pem;
  110. {% endif %}
  111. {% if matrix_nginx_proxy_ssl_session_tickets_off %}
  112. ssl_session_tickets off;
  113. {% endif %}
  114. ssl_session_cache {{ matrix_nginx_proxy_ssl_session_cache }};
  115. ssl_session_timeout {{ matrix_nginx_proxy_ssl_session_timeout }};
  116. {{ render_vhost_directives() }}
  117. }
  118. {% endif %}