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.
 
 

52 lines
1.3 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 on;
  29. ssl_certificate {{ matrix_ssl_certs_path }}/live/{{ hostname_matrix }}/fullchain;
  30. ssl_certificate_key {{ matrix_ssl_certs_path }}/live/{{ hostname_matrix }}/privkey;
  31. ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
  32. ssl_prefer_server_ciphers on;
  33. ssl_ciphers "EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH";
  34. location /_matrix {
  35. proxy_pass http://{{ 'synapse' if matrix_nginx_proxy_enabled else 'localhost' }}:8008;
  36. proxy_set_header X-Forwarded-For $remote_addr;
  37. client_body_buffer_size 25M;
  38. client_max_body_size {{ matrix_max_upload_size_mb }}M;
  39. proxy_max_temp_file_size 0;
  40. }
  41. }