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.
 
 

73 lines
1.8 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. 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. }