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.
 
 

99 lines
3.1 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. {% for configuration_block in matrix_nginx_proxy_proxy_jitsi_additional_server_configuration_blocks %}
  8. {{- configuration_block }}
  9. {% endfor %}
  10. location / {
  11. {% if matrix_nginx_proxy_enabled %}
  12. {# Use the embedded DNS resolver in Docker containers to discover the service #}
  13. resolver 127.0.0.11 valid=5s;
  14. set $backend "matrix-jitsi-web:80";
  15. proxy_pass http://$backend;
  16. {% else %}
  17. {# Generic configuration for use outside of our container setup #}
  18. proxy_pass http://127.0.0.1:12080;
  19. {% endif %}
  20. proxy_set_header Host $host;
  21. proxy_set_header X-Forwarded-For $remote_addr;
  22. }
  23. # colibri (JVB) websockets
  24. location ~ ^/colibri-ws/([a-zA-Z0-9-\.]+)/(.*) {
  25. {% if matrix_nginx_proxy_enabled %}
  26. resolver 127.0.0.11 valid=5s;
  27. set $backend "matrix-jitsi-jvb:9090";
  28. proxy_pass http://$backend;
  29. {% else %}
  30. {# Generic configuration for use outside of our container setup #}
  31. proxy_pass http://127.0.0.1:12090;
  32. {% endif %}
  33. proxy_set_header Host $host;
  34. proxy_set_header X-Forwarded-For $remote_addr;
  35. proxy_set_header Upgrade $http_upgrade;
  36. proxy_set_header Connection "upgrade";
  37. proxy_http_version 1.1;
  38. tcp_nodelay on;
  39. }
  40. {% endmacro %}
  41. server {
  42. listen {{ 8080 if matrix_nginx_proxy_enabled else 80 }};
  43. server_name {{ matrix_nginx_proxy_proxy_jitsi_hostname }};
  44. server_tokens off;
  45. root /dev/null;
  46. {% if matrix_nginx_proxy_https_enabled %}
  47. location /.well-known/acme-challenge {
  48. {% if matrix_nginx_proxy_enabled %}
  49. {# Use the embedded DNS resolver in Docker containers to discover the service #}
  50. resolver 127.0.0.11 valid=5s;
  51. set $backend "matrix-certbot:8080";
  52. proxy_pass http://$backend;
  53. {% else %}
  54. {# Generic configuration for use outside of our container setup #}
  55. proxy_pass http://127.0.0.1:{{ matrix_ssl_lets_encrypt_certbot_standalone_http_port }};
  56. {% endif %}
  57. }
  58. location / {
  59. return 301 https://$http_host$request_uri;
  60. }
  61. {% else %}
  62. {{ render_vhost_directives() }}
  63. {% endif %}
  64. }
  65. {% if matrix_nginx_proxy_https_enabled %}
  66. server {
  67. listen {{ 8443 if matrix_nginx_proxy_enabled else 443 }} ssl http2;
  68. listen [::]:{{ 8443 if matrix_nginx_proxy_enabled else 443 }} ssl http2;
  69. server_name {{ matrix_nginx_proxy_proxy_jitsi_hostname }};
  70. server_tokens off;
  71. root /dev/null;
  72. ssl_certificate {{ matrix_ssl_config_dir_path }}/live/{{ matrix_nginx_proxy_proxy_jitsi_hostname }}/fullchain.pem;
  73. ssl_certificate_key {{ matrix_ssl_config_dir_path }}/live/{{ matrix_nginx_proxy_proxy_jitsi_hostname }}/privkey.pem;
  74. ssl_protocols {{ matrix_nginx_proxy_ssl_protocols }};
  75. {% if matrix_nginx_proxy_ssl_ciphers != '' %}
  76. ssl_ciphers {{ matrix_nginx_proxy_ssl_ciphers }};
  77. {% endif %}
  78. ssl_prefer_server_ciphers {{ matrix_nginx_proxy_ssl_prefer_server_ciphers }};
  79. {{ render_vhost_directives() }}
  80. }
  81. {% endif %}