<%
=begin

Cookbook Name:: nginx
Attributes:: default

Author:: Damian Curry (<damian.curry@nginx.com>)

Copyright (c) 2017-present, NGINX, Inc.

This source code is licensed under the Apache License (v2.0) found in the LICENSE file in
the root directory of this source tree.

=end
%>

# Dynamically generated by Chef - local modifications will be overwritten

user  <%= node['nginx']['user'] %>;
worker_processes  <%= node['nginx']['worker_processes'] %>;

error_log  <%= node['nginx']['log_dir'] %>/error.log <%= node['nginx']['error_log_level'] %>;
pid        <%= node['nginx']['pid'] %>;

events {
    worker_connections  <%= node['nginx']['worker_connections'] %>;
}

http {
    include       /etc/nginx/mime.types;
    default_type  application/octet-stream;

    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';

    access_log  <%= node['nginx']['log_dir'] %>/access.log  main;

    sendfile        on;
    tcp_nopush     <%= node['nginx']['tcp_nopush'] %>;

    keepalive_timeout  65;

    #gzip  on;

    include <%= node['nginx']['dir'] %>/conf.d/*.conf;
}

<% if node['nginx']['enable_streams']==true -%>
# TCP/UDP proxy and load balancing block
stream {
    include <%= node['nginx']['stream_conf_dir'] %>;
}
<% end -%>
