load_module {{ OS.nginx.dirs.conf }}/modules/ngx_http_waf_module.so;

user  {{ OS.fpm.config.pool.listen.user }};
worker_processes {{ ansible_processor_vcpus }};

error_log  {{ OS.nginx.dirs.logs }}/error.log warn;
pid        /var/run/nginx.pid;

events {
    worker_connections  1024;
}

http {
	##
    # Nemesida WAF
    ##

    ## Request body too large fix
    client_body_buffer_size 25M;

    include {{ OS.nginx.dirs.conf }}/nwaf/conf/global/*.conf;
    include	{{ OS.nginx.dirs.conf }}/nwaf/conf/vhosts/*.conf;
    include {{ OS.nginx.dirs.conf }}/mime.types;
    default_type  application/octet-stream;

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

    access_log  {{ OS.nginx.dirs.logs }}/access.log  main;

    sendfile        on;
    #tcp_nopush     on;

    keepalive_timeout  65;
    ignore_invalid_headers off;
	
    #gzip  on;

    include {{ OS.nginx.dirs.conf }}/conf.d/*.conf;
}
