Matrix Docker Ansible eploy
Não pode escolher mais do que 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 

61 linhas
1.9 KiB

  1. #jinja2: lstrip_blocks: "True"
  2. {% macro render_vhost_directives() %}
  3. {% for configuration_block in matrix_nginx_proxy_proxy_riot_additional_server_configuration_blocks %}
  4. {{- configuration_block }}
  5. {% endfor %}
  6. location / {
  7. return 301 https://{{ matrix_nginx_proxy_proxy_element_hostname }}$request_uri;
  8. }
  9. {% endmacro %}
  10. server {
  11. listen {{ 8080 if matrix_nginx_proxy_enabled else 80 }};
  12. server_name {{ matrix_nginx_proxy_proxy_riot_compat_redirect_hostname }};
  13. server_tokens off;
  14. root /dev/null;
  15. {% if matrix_nginx_proxy_https_enabled %}
  16. location /.well-known/acme-challenge {
  17. {% if matrix_nginx_proxy_enabled %}
  18. {# Use the embedded DNS resolver in Docker containers to discover the service #}
  19. resolver 127.0.0.11 valid=5s;
  20. set $backend "matrix-certbot:8080";
  21. proxy_pass http://$backend;
  22. {% else %}
  23. {# Generic configuration for use outside of our container setup #}
  24. proxy_pass http://127.0.0.1:{{ matrix_ssl_lets_encrypt_certbot_standalone_http_port }};
  25. {% endif %}
  26. }
  27. location / {
  28. return 301 https://$http_host$request_uri;
  29. }
  30. {% else %}
  31. {{ render_vhost_directives() }}
  32. {% endif %}
  33. }
  34. {% if matrix_nginx_proxy_https_enabled %}
  35. server {
  36. listen {{ 8443 if matrix_nginx_proxy_enabled else 443 }} ssl http2;
  37. listen [::]:{{ 8443 if matrix_nginx_proxy_enabled else 443 }} ssl http2;
  38. server_name {{ matrix_nginx_proxy_proxy_riot_compat_redirect_hostname }};
  39. server_tokens off;
  40. root /dev/null;
  41. ssl_certificate {{ matrix_ssl_config_dir_path }}/live/{{ matrix_nginx_proxy_proxy_riot_compat_redirect_hostname }}/fullchain.pem;
  42. ssl_certificate_key {{ matrix_ssl_config_dir_path }}/live/{{ matrix_nginx_proxy_proxy_riot_compat_redirect_hostname }}/privkey.pem;
  43. ssl_protocols {{ matrix_nginx_proxy_ssl_protocols }};
  44. ssl_prefer_server_ciphers on;
  45. ssl_ciphers "EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH";
  46. {{ render_vhost_directives() }}
  47. }
  48. {% endif %}