nginx.conf.j2 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. user {{ nginx_user }};
  2. error_log /var/log/nginx/error.log warn;
  3. pid /var/run/nginx.pid;
  4. worker_processes {{ nginx_worker_processes }};
  5. events {
  6. worker_connections {{ nginx_worker_connections }};
  7. }
  8. http {
  9. include /etc/nginx/mime.types;
  10. default_type application/octet-stream;
  11. server_names_hash_bucket_size 64;
  12. client_max_body_size {{ nginx_client_max_body_size }};
  13. log_format main '$remote_addr - $remote_user [$time_local] "$request" '
  14. '$status $body_bytes_sent "$http_referer" '
  15. '"$http_user_agent" "$http_x_forwarded_for"';
  16. access_log /var/log/nginx/access.log main buffer=16k;
  17. sendfile on;
  18. #tcp_nopush on;
  19. keepalive_timeout {{ nginx_keepalive_timeout }};
  20. #gzip on;
  21. {% if nginx_proxy_cache_path %}
  22. proxy_cache_path {{ nginx_proxy_cache_path }};
  23. {% endif %}
  24. {% for upstream in nginx_upstreams %}
  25. upstream {{ upstream.name }} {
  26. {% if upstream.strategy is defined %}
  27. {{ upstream.strategy }};
  28. {% endif %}
  29. {% for server in upstream.servers %}
  30. server {{ server }};
  31. {% endfor %}
  32. }
  33. {% endfor %}
  34. include {{ nginx_vhost_path }}/*;
  35. }