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.
 
 

60 rivejä
1.5 KiB

  1. server {
  2. listen 80;
  3. server_name {{ hostname_matrix }};
  4. server_tokens off;
  5. location /.well-known/acme-challenge {
  6. {#
  7. The proxy can access the files directly.
  8. An external server likely does not have permission to read these files,
  9. so we'll just proxy to acme's :402 port.
  10. #}
  11. {%- if matrix_nginx_proxy_enabled -%}
  12. default_type "text/plain";
  13. alias {{ matrix_ssl_certs_path }}/run/acme-challenge;
  14. {%- else -%}
  15. proxy_pass http://localhost:402;
  16. {% endif %}
  17. }
  18. location / {
  19. return 301 https://$http_host$request_uri;
  20. }
  21. }
  22. server {
  23. listen 443 ssl http2;
  24. listen [::]:443 ssl http2;
  25. server_name {{ hostname_matrix }};
  26. server_tokens off;
  27. root /dev/null;
  28. ssl_certificate {{ matrix_ssl_certs_path }}/live/{{ hostname_matrix }}/fullchain;
  29. ssl_certificate_key {{ matrix_ssl_certs_path }}/live/{{ hostname_matrix }}/privkey;
  30. ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
  31. ssl_prefer_server_ciphers on;
  32. ssl_ciphers "EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH";
  33. location /_matrix {
  34. {% if matrix_nginx_proxy_enabled %}
  35. {# Use the embedded DNS resolver in Docker containers to discover the service #}
  36. resolver 127.0.0.11 valid=5s;
  37. set $backend "matrix-synapse:8008";
  38. proxy_pass http://$backend;
  39. {% else %}
  40. {# Generic configuration for people to use outside of our container setup #}
  41. proxy_pass http://localhost:8008;
  42. {% endif %}
  43. proxy_set_header X-Forwarded-For $remote_addr;
  44. client_body_buffer_size 25M;
  45. client_max_body_size {{ matrix_synapse_max_upload_size_mb }}M;
  46. proxy_max_temp_file_size 0;
  47. }
  48. }