
user  www;
worker_processes  1;
worker_priority  -5; 
#error_log  logs/error.log;
#error_log  logs/error.log  notice;
error_log  /var/log/nginx/error.log  info;

pid        /var/run/nginx.pid;


events {
    worker_connections  5000;
}


http {
    include       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  /var/log/nginx/access.log  main;

    sendfile        on;
    tcp_nopush     on;

    #keepalive_timeout  0;
    keepalive_timeout  5;
    tcp_nodelay        on;
    reset_timedout_connection on;

    gzip  off;
    gzip_min_length  1100;
    gzip_buffers     4 8k;
    gzip_types       text/plain;

    output_buffers   1 32k;
    postpone_output  1460;

    server_names_hash_bucket_size 128;

    proxy_buffers 16 64k; 
    proxy_set_header        X-Real-IP  $remote_addr;
    proxy_set_header        Host    $host;
    proxy_pass_header   X-Forwarded-For;
    proxy_read_timeout 3600;
    proxy_send_timeout 3600;

    server{
            listen      127.0.0.1:8000;
            server_name 127.0.0.1;
            access_log  off;
            error_log   off;
            stub_status on;
    }

    server {
        listen      xx.xx.xx.xx:8000 default sndbuf=98304 backlog=2048 accept_filter=httpready;
        server_name domen1.com www.domen1.com;
	set $mydocroot /home/user/domains/domen1.com/public_html;
        #access_log  /var/log/nginx/domen1.com.access.log  main;
	access_log  off;
        error_log  /var/log/nginx/domen1.com.error.log  warn;

        location / {
                proxy_pass   http://xx.xxx.xx.xx:80;
        }

        location ~ \.(jpg|jpeg|gif|png|ico|css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|txt|tar|mid|midi|wav|bmp|rtf|js)$ {
        	
		index  index.html index.htm index.php index.shtml;
		
		access_log off;
		root $mydocroot;            
        }

        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }

        location ~ /\.ht {
            deny  all;
        }
    }

    server {
        listen    yy.yy.yy.yy:8000  default sndbuf=98304 backlog=2048 accept_filter=httpready;
        server_name domen2.com www.domen2.com;
	set $mydocroot /home/user/domains/domen2.com/public_html;
        #access_log  /var/log/nginx/domen2.com.access.log  main;
	access_log  off;
        error_log  /var/log/nginx/domen2.com.error.log  warn;

        location / {
                proxy_pass   http://yy.yy.yy.yy:80;
        }

        location ~ \.(jpg|jpeg|gif|png|ico|css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|txt|tar|mid|midi|wav|bmp|rtf|js)$ {
        	
		index  index.html index.htm index.php index.shtml;
		
		access_log off;
		root $mydocroot;            
        }

        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }

        location ~ /\.ht {
            deny  all;
        }
    }


}
