nginx.conf.j2 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. user {{ nginx_user }};
  2. error_log {{ nginx_error_log }};
  3. pid {{ nginx_pidfile }};
  4. worker_processes {{ nginx_worker_processes }};
  5. events {
  6. worker_connections {{ nginx_worker_connections }};
  7. multi_accept {{ nginx_multi_accept }};
  8. }
  9. {% if nginx_extra_conf_options %}
  10. {{ nginx_extra_conf_options }}
  11. {% endif %}
  12. http {
  13. include {{ nginx_mime_file_path }};
  14. default_type application/octet-stream;
  15. server_names_hash_bucket_size {{ nginx_server_names_hash_bucket_size }};
  16. client_max_body_size {{ nginx_client_max_body_size }};
  17. log_format main {{ nginx_log_format|indent(23) }};
  18. access_log {{ nginx_access_log }};
  19. sendfile {{ nginx_sendfile }};
  20. tcp_nopush {{ nginx_tcp_nopush }};
  21. tcp_nodelay {{ nginx_tcp_nodelay }};
  22. keepalive_timeout {{ nginx_keepalive_timeout }};
  23. keepalive_requests {{ nginx_keepalive_requests }};
  24. server_tokens {{ nginx_server_tokens }};
  25. #gzip on;
  26. {% if nginx_proxy_cache_path %}
  27. proxy_cache_path {{ nginx_proxy_cache_path }};
  28. {% endif %}
  29. {% if nginx_extra_http_options %}
  30. {{ nginx_extra_http_options|indent(4, False) }}
  31. {% endif %}
  32. {% for upstream in nginx_upstreams %}
  33. upstream {{ upstream.name }} {
  34. {% if upstream.strategy is defined %}
  35. {{ upstream.strategy }};
  36. {% endif %}
  37. {% for server in upstream.servers %}
  38. server {{ server }};
  39. {% endfor %}
  40. {% if upstream.keepalive is defined %}
  41. keepalive {{ upstream.keepalive }};
  42. {% endif %}
  43. }
  44. {% endfor %}
  45. include {{ nginx_conf_path }}/*.conf;
  46. {% if nginx_conf_path != nginx_vhost_path %}
  47. include {{ nginx_vhost_path }}/*;
  48. {% endif %}
  49. }