#######################################################################
#
# This is the main Nginx configuration file.  
#
# More information about the configuration options is available on 
#   * the English wiki - http://wiki.nginx.org/Main
#   * the Russian documentation - http://sysoev.ru/nginx/
#
#######################################################################

#----------------------------------------------------------------------
# Main Module - directives that cover basic functionality
#
#   http://wiki.nginx.org/NginxHttpMainModule
#
#----------------------------------------------------------------------

user              nginx;
worker_processes  2;
worker_rlimit_nofile 32768; 

error_log  /var/log/nginx/error.log;
pid        /var/run/nginx.pid;


#----------------------------------------------------------------------
# Events Module 
#
#   http://wiki.nginx.org/NginxHttpEventsModule
#
#----------------------------------------------------------------------

events {
   worker_connections  4096;
    use epoll;
}


#----------------------------------------------------------------------
# HTTP Core Module
#
#   http://wiki.nginx.org/NginxHttpCoreModule 
#
#----------------------------------------------------------------------

http {
    include                       /etc/nginx/mime.types;
    default_type                  application/octet-stream;
    sendfile                      on;
	expires 					  -1; 
    server_tokens 				  off;     
    tcp_nopush                    on;
    tcp_nodelay	                  on;
    client_max_body_size          50m;
    server_names_hash_bucket_size 128;
    server_names_hash_max_size    1024;
    keepalive_timeout			  65;
    types_hash_max_size 		  2048; 
    server_name_in_redirect 	  off

    gzip                          on;    
    gzip_types                    application/x-javascript application/javascript text/xml text/css text/plain;
    gzip_vary                     on;
    gzip_proxied                  any;
    gzip_disable                  "MSIE [1-6] \.";

    log_format hostcombined '$server_name $remote_addr - $remote_user [$time_local]  "$request" $status $body_bytes_sent "$http_referer" "$http_user_agent"';
    access_log                   /var/log/nginx/access.log hostcombined;
    error_log                    /var/log/nginx/error.log info;

    upstream uwsgi_upstream {
        server unix:/var/run/uwsgi/uwsgi.sock;     
    }

    # Load config files from the /etc/nginx/conf.d directory
    include                      /etc/nginx/conf.d/*.conf;
    include                      /etc/nginx/sites-enabled/*.conf;
}
