Matrix Docker Ansible eploy
25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.
 
 

76 satır
2.0 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_cinny_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. # Inspired by: https://raw.githubusercontent.com/cinnyapp/cinny/dev/docker-nginx.conf
  44. root /usr/share/nginx/html;
  45. rewrite ^/config.json$ /config.json break;
  46. rewrite ^/manifest.json$ /manifest.json break;
  47. rewrite ^.*/olm.wasm$ /olm.wasm break;
  48. rewrite ^/sw.js$ /sw.js break;
  49. rewrite ^/pdf.worker.min.js$ /pdf.worker.min.js break;
  50. rewrite ^/public/(.*)$ /public/$1 break;
  51. rewrite ^/assets/(.*)$ /assets/$1 break;
  52. rewrite ^(.+)$ /index.html break;
  53. }
  54. }
  55. }