Matrix Docker Ansible eploy
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

71 строка
1.7 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. # (mounting `/dev/null` over `/etc/nginx/conf.d/default.conf` works well)
  7. #
  8. # The following changes have been done compared to a default nginx configuration file:
  9. # - default server port is changed (80 -> 8080), so that a non-root user can bind it
  10. # - various temp paths are changed to `/tmp`, so that a non-root user can write to them
  11. # - the `user` directive was removed, as we don't want nginx to switch users
  12. worker_processes 1;
  13. error_log /var/log/nginx/error.log warn;
  14. pid /tmp/nginx.pid;
  15. events {
  16. worker_connections 1024;
  17. }
  18. http {
  19. proxy_temp_path /tmp/proxy_temp;
  20. client_body_temp_path /tmp/client_temp;
  21. fastcgi_temp_path /tmp/fastcgi_temp;
  22. uwsgi_temp_path /tmp/uwsgi_temp;
  23. scgi_temp_path /tmp/scgi_temp;
  24. include /etc/nginx/mime.types;
  25. default_type application/octet-stream;
  26. log_format main '$remote_addr - $remote_user [$time_local] "$request" '
  27. '$status $body_bytes_sent "$http_referer" '
  28. '"$http_user_agent" "$http_x_forwarded_for"';
  29. {% if matrix_client_hydrogen_access_log_enabled %}
  30. access_log /var/log/nginx/access.log main;
  31. {% else %}
  32. access_log off;
  33. {% endif %}
  34. sendfile on;
  35. #tcp_nopush on;
  36. keepalive_timeout 65;
  37. #gzip on;
  38. server {
  39. listen 8080;
  40. server_name localhost;
  41. root /usr/share/nginx/html;
  42. location / {
  43. index index.html index.htm;
  44. }
  45. location ~* ^/(config(.+)?\.json$|(.+)\.html$|i18n) {
  46. expires -1;
  47. }
  48. error_page 500 502 503 504 /50x.html;
  49. location = /50x.html {
  50. root /usr/share/nginx/html;
  51. }
  52. }
  53. }