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.
 
 

59 line
1.5 KiB

  1. server {
  2. listen 80;
  3. server_name {{ hostname_riot }};
  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_riot }};
  26. server_tokens off;
  27. root /dev/null;
  28. gzip on;
  29. gzip_types text/plain text/html application/json application/javascript text/css image/x-icon font/ttf image/gif;
  30. ssl_certificate {{ matrix_ssl_certs_path }}/live/{{ hostname_riot }}/fullchain;
  31. ssl_certificate_key {{ matrix_ssl_certs_path }}/live/{{ hostname_riot }}/privkey;
  32. ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
  33. ssl_prefer_server_ciphers on;
  34. ssl_ciphers "EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH";
  35. location / {
  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-riot-web:8765";
  40. proxy_pass http://$backend;
  41. {% else %}
  42. {# Generic configuration for use outside of our container setup #}
  43. proxy_pass http://localhost:8765;
  44. {% endif %}
  45. proxy_set_header X-Forwarded-For $remote_addr;
  46. }
  47. }