nginx.conf.j2 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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. server_tokens {{ nginx_server_tokens }};
  27. #gzip on;
  28. {% if nginx_proxy_cache_path %}
  29. proxy_cache_path {{ nginx_proxy_cache_path }};
  30. {% endif %}
  31. {% if nginx_extra_http_options %}
  32. {{ nginx_extra_http_options|indent(4, False) }}
  33. {% endif %}
  34. {% for upstream in nginx_upstreams %}
  35. upstream {{ upstream.name }} {
  36. {% if upstream.strategy is defined %}
  37. {{ upstream.strategy }};
  38. {% endif %}
  39. {% for server in upstream.servers %}
  40. server {{ server }};
  41. {% endfor %}
  42. {% if upstream.keepalive is defined %}
  43. keepalive {{ upstream.keepalive }};
  44. {% endif %}
  45. }
  46. {% endfor %}
  47. include {{ nginx_conf_path }}/*.conf;
  48. {% if nginx_conf_path != nginx_vhost_path %}
  49. include {{ nginx_vhost_path }}/*;
  50. {% endif %}
  51. }