nginx.conf.j2 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. user {{ nginx_user }};
  2. error_log {{ nginx_error_log }};
  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 {{ nginx_access_log }};
  17. sendfile {{ nginx_sendfile }};
  18. tcp_nopush {{ nginx_tcp_nopush }};
  19. tcp_nodelay {{ nginx_tcp_nodelay }};
  20. keepalive_timeout {{ nginx_keepalive_timeout }};
  21. keepalive_requests {{ nginx_keepalive_requests }};
  22. #gzip on;
  23. {% if nginx_proxy_cache_path %}
  24. proxy_cache_path {{ nginx_proxy_cache_path }};
  25. {% endif %}
  26. {% if nginx_extra_options %}
  27. {{ nginx_extra_options }}
  28. {% endif %}
  29. {% for upstream in nginx_upstreams %}
  30. upstream {{ upstream.name }} {
  31. {% if upstream.strategy is defined %}
  32. {{ upstream.strategy }};
  33. {% endif %}
  34. {% for server in upstream.servers %}
  35. server {{ server }};
  36. {% endfor %}
  37. }
  38. {% endfor %}
  39. include {{ nginx_conf_path }}/*.conf;
  40. {% if nginx_conf_path != nginx_vhost_path %}
  41. include {{ nginx_vhost_path }}/*.conf;
  42. {% endif %}
  43. }