worker_processes 8;
worker_rlimit_nofile 65536;

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

pid /run/nginx.pid;
include /etc/nginx/modules-enabled/*.conf;

events {
	use epoll;
	multi_accept on;
	accept_mutex on;
	accept_mutex_delay 500ms; # Default
	worker_connections  10000;
}

http {
	server_names_hash_bucket_size 128;
	client_body_buffer_size    4m;
	proxy_buffering on;
	proxy_connect_timeout      300; #время на ожидание соединения
	proxy_send_timeout         300;
	proxy_read_timeout         300;

	proxy_buffer_size          128k;
	proxy_buffers              8 128k;
	proxy_busy_buffers_size    128k;

	proxy_temp_file_write_size 10m;
	proxy_max_temp_file_size 0;

	sendfile on;
	#sendfile_max_chunk 512k;

	tcp_nopush     on;
	tcp_nodelay    on;

	client_max_body_size 100000m;
	open_file_cache max=200000 inactive=20s;
	open_file_cache_valid 30s;
	open_file_cache_min_uses 2;
	open_file_cache_errors on;
	gzip on;
	gzip_min_length 1200;
	gzip_proxied any;
	gzip_types text/plain text/css text/xml text/javascript application/x-javascript application/xml application/json application/xml+rss application/javascript;
	gzip_disable "msie6";
	gzip_comp_level 1;


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

	log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
		      '$status $body_bytes_sent rt=$request_time uct=$upstream_connect_time urt=$upstream_response_time '
		      '"$http_referer" "$http_user_agent" "$http_x_forwarded_for"';

	access_log  /var/log/nginx/access.log  main;

	#tcp_nopush     on;

	#keepalive_timeout  0;
	keepalive_timeout  65;
	keepalive_requests 1000;

	map $http_upgrade $connection_upgrade_ws {
		default upgrade;
		'' close;
	}


	### ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3; # Dropping SSLv3, ref: POODLE
	### ssl_prefer_server_ciphers on;

	include /etc/nginx/conf.d/*.conf;
	### include /etc/nginx/sites-enabled/*;
}

