Matrix Docker Ansible eploy
Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.
 
 

98 wiersze
3.4 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 {{ matrix_nginx_proxy_http_level_resolver }} 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 {{ matrix_nginx_proxy_x_forwarded_for }};
  27. }
  28. {% endmacro %}
  29. server {
  30. listen {{ 8080 if matrix_nginx_proxy_enabled else 80 }};
  31. listen [::]:{{ 8080 if matrix_nginx_proxy_enabled else 80 }};
  32. server_name {{ matrix_nginx_proxy_proxy_bot_go_neb_hostname }};
  33. server_tokens off;
  34. root /dev/null;
  35. {% if matrix_nginx_proxy_https_enabled %}
  36. location /.well-known/acme-challenge {
  37. {% if matrix_nginx_proxy_enabled %}
  38. {# Use the embedded DNS resolver in Docker containers to discover the service #}
  39. resolver {{ matrix_nginx_proxy_http_level_resolver }} valid=5s;
  40. set $backend "matrix-certbot:8080";
  41. proxy_pass http://$backend;
  42. {% else %}
  43. {# Generic configuration for use outside of our container setup #}
  44. proxy_pass http://127.0.0.1:{{ matrix_ssl_lets_encrypt_certbot_standalone_http_port }};
  45. {% endif %}
  46. }
  47. location / {
  48. return 301 https://$http_host$request_uri;
  49. }
  50. {% else %}
  51. {{ render_vhost_directives() }}
  52. {% endif %}
  53. }
  54. {% if matrix_nginx_proxy_https_enabled %}
  55. server {
  56. listen {{ 8443 if matrix_nginx_proxy_enabled else 443 }} ssl http2;
  57. listen [::]:{{ 8443 if matrix_nginx_proxy_enabled else 443 }} ssl http2;
  58. server_name {{ matrix_nginx_proxy_proxy_bot_go_neb_hostname }};
  59. server_tokens off;
  60. root /dev/null;
  61. ssl_certificate {{ matrix_ssl_config_dir_path }}/live/{{ matrix_nginx_proxy_proxy_bot_go_neb_hostname }}/fullchain.pem;
  62. ssl_certificate_key {{ matrix_ssl_config_dir_path }}/live/{{ matrix_nginx_proxy_proxy_bot_go_neb_hostname }}/privkey.pem;
  63. ssl_protocols {{ matrix_nginx_proxy_ssl_protocols }};
  64. {% if matrix_nginx_proxy_ssl_ciphers != '' %}
  65. ssl_ciphers {{ matrix_nginx_proxy_ssl_ciphers }};
  66. {% endif %}
  67. ssl_prefer_server_ciphers {{ matrix_nginx_proxy_ssl_prefer_server_ciphers }};
  68. {% if matrix_nginx_proxy_ocsp_stapling_enabled %}
  69. ssl_stapling on;
  70. ssl_stapling_verify on;
  71. ssl_trusted_certificate {{ matrix_ssl_config_dir_path }}/live/{{ matrix_nginx_proxy_proxy_bot_go_neb_hostname }}/chain.pem;
  72. {% endif %}
  73. {% if matrix_nginx_proxy_ssl_session_tickets_off %}
  74. ssl_session_tickets off;
  75. {% endif %}
  76. ssl_session_cache {{ matrix_nginx_proxy_ssl_session_cache }};
  77. ssl_session_timeout {{ matrix_nginx_proxy_ssl_session_timeout }};
  78. {{ render_vhost_directives() }}
  79. }
  80. {% endif %}