user			root root;
worker_processes	4;
#pid			logs/nginx.pid;
worker_rlimit_nofile	204800;

events {
	use epoll;
	worker_connections	204800;
}

http {
	include				mime.types;
	default_type			application/octet-stream;
	charset				utf-8;	
	server_names_hash_bucket_size	128;
	client_header_buffer_size	2k;
	large_client_header_buffers	4 4k;
	client_max_body_size		8m;
	sendfile			on;
	tcp_nopush     			on;
	keepalive_timeout		60;
	open_file_cache			max=204800 inactive=20s;
	open_file_cache_min_uses	1;
	open_file_cache_valid		30s;
	tcp_nodelay			on;
	gzip				on;
	gzip_min_length			1k;
	gzip_buffers			4 16k;
	gzip_http_version		1.0;
	gzip_comp_level			2;
	gzip_types			text/plain application/x-javascript text/css application/xml;
	gzip_vary			on;
        server_tokens                   off;
 
	upstream  backend  {
		server	jpress:8080 max_fails=1 fail_timeout=60s;
	}

#	server {
#		listen			443;
#		server_name		jpress;
#		ssl			on;
#		ssl_certificate		./cert/server.crt;
#		ssl_certificate_key	./cert/server.key;
#		ssl_session_timeout	5m;
#		ssl_protocols		SSLv2 SSLv3 TLSv1;
#		ssl_ciphers		HIGH:!aNULL:!MD5;
#		ssl_prefer_server_ciphers	on;
#		location ~* .*\.(html|gif|jpg|jpeg|png|bmp|ico|rar|css|js|zip|java|jar|txt|flv|swf|mid|doc|ppt|xls|pdf|txt|mp3|wma|mp4)$ {
#			root /etc/nginx/static;
#		}
#		location / {
#			proxy_pass		http://xxx.xxx.com;
#			proxy_set_header	Host		$host;
#			proxy_set_header	X-Real-IP	$remote_addr;
#			proxy_set_header	X-Forwarded-For	$proxy_add_x_forwarded_for;
#		}
#	}

	server {
		listen		80;
        server_name	localhost;
		ssl		off;
		location ~* .*\.(gif|jpg|jpeg|png|bmp|ico|rar|css|js|zip|java|jar|txt|flv|swf|mid|doc|ppt|xls|pdf|txt|mp3|wma|mp4)$ {
			root /etc/nginx/statics;
                        expires    30d;
		}
		location / {
			proxy_pass		http://backend;
			proxy_set_header	Host		$host;
			proxy_set_header	X-Real-IP	$remote_addr;
			proxy_set_header	X-Forwarded-For	$proxy_add_x_forwarded_for;
		}
	}

}
