Matrix Docker Ansible eploy
Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.
 
 

96 righe
3.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. {% if matrix_nginx_proxy_hsts_preload_enabled %}
  6. add_header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload" always;
  7. {% else %}
  8. add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
  9. {% endif %}
  10. add_header X-XSS-Protection "{{ matrix_nginx_proxy_xss_protection }}";
  11. add_header X-Content-Type-Options nosniff;
  12. {% for configuration_block in matrix_nginx_proxy_proxy_bot_go_neb_additional_server_configuration_blocks %}
  13. {{- configuration_block }}
  14. {% endfor %}
  15. location / {
  16. {% if matrix_nginx_proxy_enabled %}
  17. {# Use the embedded DNS resolver in Docker containers to discover the service #}
  18. resolver 127.0.0.11 valid=5s;
  19. set $backend "matrix-bot-go-neb:4050";
  20. proxy_pass http://$backend;
  21. {% else %}
  22. {# Generic configuration for use outside of our container setup #}
  23. proxy_pass http://127.0.0.1:4050;
  24. {% endif %}
  25. proxy_set_header Host $host;
  26. proxy_set_header X-Forwarded-For $remote_addr;
  27. }
  28. {% endmacro %}
  29. server {
  30. listen {{ 8080 if matrix_nginx_proxy_enabled else 80 }};
  31. server_name {{ matrix_nginx_proxy_proxy_bot_go_neb_hostname }};
  32. server_tokens off;
  33. root /dev/null;
  34. {% if matrix_nginx_proxy_https_enabled %}
  35. location /.well-known/acme-challenge {
  36. {% if matrix_nginx_proxy_enabled %}
  37. {# Use the embedded DNS resolver in Docker containers to discover the service #}
  38. resolver 127.0.0.11 valid=5s;
  39. set $backend "matrix-certbot:8080";
  40. proxy_pass http://$backend;
  41. {% else %}
  42. {# Generic configuration for use outside of our container setup #}
  43. proxy_pass http://127.0.0.1:{{ matrix_ssl_lets_encrypt_certbot_standalone_http_port }};
  44. {% endif %}
  45. }
  46. location / {
  47. return 301 https://$http_host$request_uri;
  48. }
  49. {% else %}
  50. {{ render_vhost_directives() }}
  51. {% endif %}
  52. }
  53. {% if matrix_nginx_proxy_https_enabled %}
  54. server {
  55. listen {{ 8443 if matrix_nginx_proxy_enabled else 443 }} ssl http2;
  56. listen [::]:{{ 8443 if matrix_nginx_proxy_enabled else 443 }} ssl http2;
  57. server_name {{ matrix_nginx_proxy_proxy_bot_go_neb_hostname }};
  58. server_tokens off;
  59. root /dev/null;
  60. ssl_certificate {{ matrix_ssl_config_dir_path }}/live/{{ matrix_nginx_proxy_proxy_bot_go_neb_hostname }}/fullchain.pem;
  61. ssl_certificate_key {{ matrix_ssl_config_dir_path }}/live/{{ matrix_nginx_proxy_proxy_bot_go_neb_hostname }}/privkey.pem;
  62. ssl_protocols {{ matrix_nginx_proxy_ssl_protocols }};
  63. {% if matrix_nginx_proxy_ssl_ciphers != '' %}
  64. ssl_ciphers {{ matrix_nginx_proxy_ssl_ciphers }};
  65. {% endif %}
  66. ssl_prefer_server_ciphers {{ matrix_nginx_proxy_ssl_prefer_server_ciphers }};
  67. {% if matrix_nginx_proxy_ocsp_stapling_enabled %}
  68. ssl_stapling on;
  69. ssl_stapling_verify on;
  70. ssl_trusted_certificate {{ matrix_ssl_config_dir_path }}/live/{{ matrix_nginx_proxy_proxy_bot_go_neb_hostname }}/chain.pem;
  71. {% endif %}
  72. {% if matrix_nginx_proxy_ssl_session_tickets_off %}
  73. ssl_session_tickets off;
  74. {% endif %}
  75. ssl_session_cache {{ matrix_nginx_proxy_ssl_session_cache }};
  76. ssl_session_timeout {{ matrix_nginx_proxy_ssl_session_timeout }};
  77. {{ render_vhost_directives() }}
  78. }
  79. {% endif %}