Matrix Docker Ansible eploy
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

104 lines
3.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. {% endmacro %}
  44. server {
  45. listen {{ 8080 if matrix_nginx_proxy_enabled else 80 }};
  46. server_name {{ matrix_nginx_proxy_proxy_jitsi_hostname }};
  47. server_tokens off;
  48. root /dev/null;
  49. {% if matrix_nginx_proxy_https_enabled %}
  50. location /.well-known/acme-challenge {
  51. {% if matrix_nginx_proxy_enabled %}
  52. {# Use the embedded DNS resolver in Docker containers to discover the service #}
  53. resolver 127.0.0.11 valid=5s;
  54. set $backend "matrix-certbot:8080";
  55. proxy_pass http://$backend;
  56. {% else %}
  57. {# Generic configuration for use outside of our container setup #}
  58. proxy_pass http://127.0.0.1:{{ matrix_ssl_lets_encrypt_certbot_standalone_http_port }};
  59. {% endif %}
  60. }
  61. location / {
  62. return 301 https://$http_host$request_uri;
  63. }
  64. {% else %}
  65. {{ render_vhost_directives() }}
  66. {% endif %}
  67. }
  68. {% if matrix_nginx_proxy_https_enabled %}
  69. server {
  70. listen {{ 8443 if matrix_nginx_proxy_enabled else 443 }} ssl http2;
  71. listen [::]:{{ 8443 if matrix_nginx_proxy_enabled else 443 }} ssl http2;
  72. server_name {{ matrix_nginx_proxy_proxy_jitsi_hostname }};
  73. server_tokens off;
  74. root /dev/null;
  75. ssl_certificate {{ matrix_ssl_config_dir_path }}/live/{{ matrix_nginx_proxy_proxy_jitsi_hostname }}/fullchain.pem;
  76. ssl_certificate_key {{ matrix_ssl_config_dir_path }}/live/{{ matrix_nginx_proxy_proxy_jitsi_hostname }}/privkey.pem;
  77. ssl_protocols {{ matrix_nginx_proxy_ssl_protocols }};
  78. {% if matrix_nginx_proxy_ssl_ciphers != '' %}
  79. ssl_ciphers {{ matrix_nginx_proxy_ssl_ciphers }};
  80. {% endif %}
  81. ssl_prefer_server_ciphers {{ matrix_nginx_proxy_ssl_prefer_server_ciphers }};
  82. {{ render_vhost_directives() }}
  83. }
  84. {% endif %}