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.
 
 

57 lines
1.8 KiB

  1. server {
  2. listen {{ 8080 if matrix_nginx_proxy_enabled else 80 }};
  3. server_name {{ matrix_nginx_proxy_proxy_riot_hostname }};
  4. server_tokens off;
  5. location /.well-known/acme-challenge {
  6. {% if matrix_nginx_proxy_enabled %}
  7. {# Use the embedded DNS resolver in Docker containers to discover the service #}
  8. resolver 127.0.0.11 valid=5s;
  9. set $backend "matrix-certbot:8080";
  10. proxy_pass http://$backend;
  11. {% else %}
  12. {# Generic configuration for use outside of our container setup #}
  13. proxy_pass http://localhost:{{ matrix_ssl_lets_encrypt_certbot_standalone_http_port }};
  14. {% endif %}
  15. }
  16. location / {
  17. return 301 https://$http_host$request_uri;
  18. }
  19. }
  20. server {
  21. listen {{ 8443 if matrix_nginx_proxy_enabled else 443 }} ssl http2;
  22. listen [::]:{{ 8443 if matrix_nginx_proxy_enabled else 443 }} ssl http2;
  23. server_name {{ matrix_nginx_proxy_proxy_riot_hostname }};
  24. server_tokens off;
  25. root /dev/null;
  26. gzip on;
  27. gzip_types text/plain application/json application/javascript text/css image/x-icon font/ttf image/gif;
  28. ssl_certificate {{ matrix_ssl_config_dir_path }}/live/{{ matrix_nginx_proxy_proxy_riot_hostname }}/fullchain.pem;
  29. ssl_certificate_key {{ matrix_ssl_config_dir_path }}/live/{{ matrix_nginx_proxy_proxy_riot_hostname }}/privkey.pem;
  30. ssl_protocols {{ matrix_nginx_proxy_ssl_protocols }};
  31. ssl_prefer_server_ciphers on;
  32. ssl_ciphers "EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH";
  33. location / {
  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-riot-web:8080";
  38. proxy_pass http://$backend;
  39. {% else %}
  40. {# Generic configuration for use outside of our container setup #}
  41. proxy_pass http://localhost:8765;
  42. {% endif %}
  43. proxy_set_header Host $host;
  44. proxy_set_header X-Forwarded-For $remote_addr;
  45. }
  46. }