Matrix Docker Ansible eploy
No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.
 
 

68 líneas
2.1 KiB

  1. #jinja2: lstrip_blocks: "True"
  2. {% macro render_vhost_directives() %}
  3. root /nginx-data/matrix-domain;
  4. gzip on;
  5. gzip_types text/plain application/json;
  6. {% for configuration_block in matrix_nginx_proxy_proxy_domain_additional_server_configuration_blocks %}
  7. {{- configuration_block }}
  8. {% endfor %}
  9. location /.well-known/matrix {
  10. root {{ matrix_static_files_base_path }};
  11. {#
  12. A somewhat long expires value is used to prevent outages
  13. in case this is unreachable due to network failure.
  14. #}
  15. expires 4h;
  16. default_type application/json;
  17. add_header Access-Control-Allow-Origin *;
  18. }
  19. {% endmacro %}
  20. server {
  21. listen {{ 8080 if matrix_nginx_proxy_enabled else 80 }};
  22. server_name {{ matrix_nginx_proxy_base_domain_hostname }};
  23. server_tokens off;
  24. {% if matrix_nginx_proxy_https_enabled %}
  25. location /.well-known/acme-challenge {
  26. {% if matrix_nginx_proxy_enabled %}
  27. {# Use the embedded DNS resolver in Docker containers to discover the service #}
  28. resolver 127.0.0.11 valid=5s;
  29. set $backend "matrix-certbot:8080";
  30. proxy_pass http://$backend;
  31. {% else %}
  32. {# Generic configuration for use outside of our container setup #}
  33. proxy_pass http://127.0.0.1:{{ matrix_ssl_lets_encrypt_certbot_standalone_http_port }};
  34. {% endif %}
  35. }
  36. location / {
  37. return 301 https://$http_host$request_uri;
  38. }
  39. {% else %}
  40. {{ render_vhost_directives() }}
  41. {% endif %}
  42. }
  43. {% if matrix_nginx_proxy_https_enabled %}
  44. server {
  45. listen {{ 8443 if matrix_nginx_proxy_enabled else 443 }} ssl http2;
  46. listen [::]:{{ 8443 if matrix_nginx_proxy_enabled else 443 }} ssl http2;
  47. server_name {{ matrix_nginx_proxy_base_domain_hostname }};
  48. server_tokens off;
  49. ssl_certificate {{ matrix_ssl_config_dir_path }}/live/{{ matrix_nginx_proxy_base_domain_hostname }}/fullchain.pem;
  50. ssl_certificate_key {{ matrix_ssl_config_dir_path }}/live/{{ matrix_nginx_proxy_base_domain_hostname }}/privkey.pem;
  51. ssl_protocols {{ matrix_nginx_proxy_ssl_protocols }};
  52. ssl_prefer_server_ciphers on;
  53. ssl_ciphers "EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH";
  54. {{ render_vhost_directives() }}
  55. }
  56. {% endif %}