Matrix Docker Ansible eploy
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.
 
 

78 řádky
2.6 KiB

  1. #jinja2: lstrip_blocks: "True"
  2. # This is a custom nginx configuration file that we use in the container (instead of the default one),
  3. # because it allows us to run nginx with a non-root user.
  4. #
  5. # For this to work, the default vhost file (`/etc/nginx/conf.d/default.conf`) also needs to be removed.
  6. #
  7. # The following changes have been done compared to a default nginx configuration file:
  8. # - various temp paths are changed to `/tmp`, so that a non-root user can write to them
  9. # - the `user` directive was removed, as we don't want nginx to switch users
  10. worker_processes {{ matrix_nginx_proxy_worker_processes }};
  11. error_log /var/log/nginx/error.log warn;
  12. pid /tmp/nginx.pid;
  13. {% for configuration_block in matrix_nginx_proxy_proxy_additional_configuration_blocks %}
  14. {{- configuration_block }}
  15. {% endfor %}
  16. events {
  17. worker_connections {{ matrix_nginx_proxy_worker_connections }};
  18. {% for configuration_block in matrix_nginx_proxy_proxy_event_additional_configuration_blocks %}
  19. {{- configuration_block }}
  20. {% endfor %}
  21. }
  22. http {
  23. proxy_temp_path /tmp/proxy_temp;
  24. client_body_temp_path /tmp/client_temp;
  25. fastcgi_temp_path /tmp/fastcgi_temp;
  26. uwsgi_temp_path /tmp/uwsgi_temp;
  27. scgi_temp_path /tmp/scgi_temp;
  28. include /etc/nginx/mime.types;
  29. default_type application/octet-stream;
  30. log_format main '$remote_addr - $remote_user [$time_local] "$request" '
  31. '$status $body_bytes_sent "$http_referer" '
  32. '"$http_user_agent" "$http_x_forwarded_for"';
  33. {% if matrix_nginx_proxy_access_log_enabled %}
  34. access_log /var/log/nginx/access.log main;
  35. {% endif %}
  36. {% if matrix_nginx_proxy_access_log_syslog_integration_enabled %}
  37. log_format prometheus_fmt 'matrix-nginx-proxy $server_name - $upstream_addr - $remote_addr - $remote_user [$time_local] '
  38. '$host "$request" '
  39. '$status "$http_referer" '
  40. '"$http_user_agent" "$http_x_forwarded_for"';
  41. access_log syslog:server={{ matrix_nginx_proxy_access_log_syslog_integration_server_port }},tag=matrix_nginx_proxy prometheus_fmt;
  42. {% endif %}
  43. {% if not matrix_nginx_proxy_access_log_enabled and not matrix_nginx_proxy_access_log_syslog_integration_enabled %}
  44. access_log off;
  45. {% endif %}
  46. proxy_connect_timeout {{ matrix_nginx_proxy_connect_timeout }};
  47. proxy_send_timeout {{ matrix_nginx_proxy_send_timeout }};
  48. proxy_read_timeout {{ matrix_nginx_proxy_read_timeout }};
  49. send_timeout {{ matrix_nginx_send_timeout }};
  50. sendfile on;
  51. #tcp_nopush on;
  52. keepalive_timeout 65;
  53. server_tokens off;
  54. #gzip on;
  55. {# Map directive needed for proxied WebSocket upgrades #}
  56. map $http_upgrade $connection_upgrade {
  57. default upgrade;
  58. '' close;
  59. }
  60. include /etc/nginx/conf.d/*.conf;
  61. }