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.0 KiB

  1. {#
  2. SPDX-FileCopyrightText: 2024 MDAD Team and contributors
  3. SPDX-License-Identifier: AGPL-3.0-or-later
  4. #}
  5. #jinja2: lstrip_blocks: "True"
  6. # This is a custom nginx configuration file that we use in the container (instead of the default one),
  7. # because it allows us to run nginx with a non-root user.
  8. #
  9. # For this to work, the default vhost file (`/etc/nginx/conf.d/default.conf`) also needs to be removed.
  10. # (mounting `/dev/null` over `/etc/nginx/conf.d/default.conf` works well)
  11. #
  12. # The following changes have been done compared to a default nginx configuration file:
  13. # - default server port is changed (80 -> 8080), so that a non-root user can bind it
  14. # - various temp paths are changed to `/tmp`, so that a non-root user can write to them
  15. # - the `user` directive was removed, as we don't want nginx to switch users
  16. worker_processes 1;
  17. error_log /var/log/nginx/error.log warn;
  18. pid /tmp/nginx.pid;
  19. events {
  20. worker_connections 1024;
  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. access_log /var/log/nginx/access.log main;
  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. }