nginx.conf.j2 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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. {% if nginx_extra_conf_options %}
  9. {{ nginx_extra_conf_options }}
  10. {% endif %}
  11. http {
  12. include /etc/nginx/mime.types;
  13. default_type application/octet-stream;
  14. server_names_hash_bucket_size 64;
  15. client_max_body_size {{ nginx_client_max_body_size }};
  16. log_format main '$remote_addr - $remote_user [$time_local] "$request" '
  17. '$status $body_bytes_sent "$http_referer" '
  18. '"$http_user_agent" "$http_x_forwarded_for"';
  19. access_log {{ nginx_access_log }};
  20. sendfile {{ nginx_sendfile }};
  21. tcp_nopush {{ nginx_tcp_nopush }};
  22. tcp_nodelay {{ nginx_tcp_nodelay }};
  23. keepalive_timeout {{ nginx_keepalive_timeout }};
  24. keepalive_requests {{ nginx_keepalive_requests }};
  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 }}
  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. }
  41. {% endfor %}
  42. include {{ nginx_conf_path }}/*.conf;
  43. {% if nginx_conf_path != nginx_vhost_path %}
  44. include {{ nginx_vhost_path }}/*.conf;
  45. {% endif %}
  46. }