Matrix Docker Ansible eploy
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
 
 

70 lignes
2.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. location / {
  6. {% if matrix_nginx_proxy_enabled %}
  7. {# Use the embedded DNS resolver in Docker containers to discover the service #}
  8. resolver 127.0.0.11 valid=5s;
  9. set $backend "matrix-dimension:8184";
  10. proxy_pass http://$backend;
  11. {% else %}
  12. {# Generic configuration for use outside of our container setup #}
  13. proxy_pass http://127.0.0.1:8184;
  14. {% endif %}
  15. proxy_set_header Host $host;
  16. proxy_set_header X-Forwarded-For $remote_addr;
  17. }
  18. {% endmacro %}
  19. server {
  20. listen {{ 8080 if matrix_nginx_proxy_enabled else 80 }};
  21. server_name {{ matrix_nginx_proxy_proxy_dimension_hostname }};
  22. server_tokens off;
  23. root /dev/null;
  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_proxy_dimension_hostname }};
  48. server_tokens off;
  49. root /dev/null;
  50. ssl_certificate {{ matrix_ssl_config_dir_path }}/live/{{ matrix_nginx_proxy_proxy_dimension_hostname }}/fullchain.pem;
  51. ssl_certificate_key {{ matrix_ssl_config_dir_path }}/live/{{ matrix_nginx_proxy_proxy_dimension_hostname }}/privkey.pem;
  52. ssl_protocols {{ matrix_nginx_proxy_ssl_protocols }};
  53. ssl_prefer_server_ciphers on;
  54. ssl_ciphers "EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH";
  55. {{ render_vhost_directives() }}
  56. }
  57. {% endif %}