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.
 
 

67 lines
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. access_log /var/log/nginx/access.log main;
  30. sendfile on;
  31. #tcp_nopush on;
  32. keepalive_timeout 65;
  33. #gzip on;
  34. server {
  35. listen 8080;
  36. server_name localhost;
  37. root /usr/share/nginx/html;
  38. location / {
  39. index index.html index.htm;
  40. }
  41. location ~* ^/(config(.+)?\.json$|(.+)\.html$|i18n) {
  42. expires -1;
  43. }
  44. error_page 500 502 503 504 /50x.html;
  45. location = /50x.html {
  46. root /usr/share/nginx/html;
  47. }
  48. }
  49. }