nginx.conf.j2 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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 '$remote_addr - $remote_user [$time_local] "$request" '
  18. '$status $body_bytes_sent "$http_referer" '
  19. '"$http_user_agent" "$http_x_forwarded_for"';
  20. access_log {{ nginx_access_log }};
  21. sendfile {{ nginx_sendfile }};
  22. tcp_nopush {{ nginx_tcp_nopush }};
  23. tcp_nodelay {{ nginx_tcp_nodelay }};
  24. keepalive_timeout {{ nginx_keepalive_timeout }};
  25. keepalive_requests {{ nginx_keepalive_requests }};
  26. #gzip on;
  27. {% if nginx_proxy_cache_path %}
  28. proxy_cache_path {{ nginx_proxy_cache_path }};
  29. {% endif %}
  30. {% if nginx_extra_http_options %}
  31. {{ nginx_extra_http_options }}
  32. {% endif %}
  33. {% for upstream in nginx_upstreams %}
  34. upstream {{ upstream.name }} {
  35. {% if upstream.strategy is defined %}
  36. {{ upstream.strategy }};
  37. {% endif %}
  38. {% for server in upstream.servers %}
  39. server {{ server }};
  40. {% endfor %}
  41. }
  42. {% endfor %}
  43. include {{ nginx_conf_path }}/*.conf;
  44. {% if nginx_conf_path != nginx_vhost_path %}
  45. include {{ nginx_vhost_path }}/*;
  46. {% endif %}
  47. }