nginx.conf.j2 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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. {% for upstream in nginx_upstreams %}
  27. upstream {{ upstream.name }} {
  28. {% if upstream.strategy is defined %}
  29. {{ upstream.strategy }};
  30. {% endif %}
  31. {% for server in upstream.servers %}
  32. server {{ server }};
  33. {% endfor %}
  34. }
  35. {% endfor %}
  36. {% if nginx_conf_path is defined %}
  37. include {{ nginx_conf_path }};
  38. {% endif %}
  39. {% if nginx_vhost_path is defined %}
  40. include {{ nginx_vhost_path }}/*;
  41. {% endif %}
  42. }