Matrix Docker Ansible eploy
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

65 lines
1.9 KiB

  1. #jinja2: lstrip_blocks: "True"
  2. server {
  3. listen {{ 8080 if matrix_nginx_proxy_enabled else 80 }};
  4. server_name {{ matrix_nginx_proxy_base_domain_hostname }};
  5. server_tokens off;
  6. {% if matrix_nginx_proxy_nginx_status_enabled %}
  7. location /nginx_status {
  8. stub_status on;
  9. access_log off;
  10. {% for address in matrix_nginx_proxy_nginx_status_allowed_addresses %}
  11. allow {{ address }};
  12. {% endfor %}
  13. deny all;
  14. }
  15. {% endif %}
  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. }
  31. server {
  32. listen {{ 8443 if matrix_nginx_proxy_enabled else 443 }} ssl http2;
  33. listen [::]:{{ 8443 if matrix_nginx_proxy_enabled else 443 }} ssl http2;
  34. server_name {{ matrix_nginx_proxy_base_domain_hostname }};
  35. server_tokens off;
  36. root /nginx-data/matrix-domain;
  37. gzip on;
  38. gzip_types text/plain application/json;
  39. ssl_certificate {{ matrix_ssl_config_dir_path }}/live/{{ matrix_nginx_proxy_base_domain_hostname }}/fullchain.pem;
  40. ssl_certificate_key {{ matrix_ssl_config_dir_path }}/live/{{ matrix_nginx_proxy_base_domain_hostname }}/privkey.pem;
  41. ssl_protocols {{ matrix_nginx_proxy_ssl_protocols }};
  42. ssl_prefer_server_ciphers on;
  43. ssl_ciphers "EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH";
  44. location /.well-known/matrix {
  45. root {{ matrix_static_files_base_path }};
  46. {#
  47. A somewhat long expires value is used to prevent outages
  48. in case this is unreachable due to network failure.
  49. #}
  50. expires 4h;
  51. default_type application/json;
  52. add_header Access-Control-Allow-Origin *;
  53. }
  54. }