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.
 
 

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