Try to repeat it yourself.
yum -y install nginx
cp /etc/nginx/nginx.conf /etc/nginx/nginx.conf.orig vim /etc/nginx/nginx.conf
# This number should be, at maximum, the number of CPU cores on your system. worker_processes 24;
# Determines how many clients will be served by each worker process. worker_connections 4000;
# Number of file descriptors used for Nginx. worker_rlimit_nofile 200000;
# Only log critical errors. error_log /var/log/nginx/error.log crit
# Fully disable log errors. error_log /dev/null crit;
# Disable access log altogether. access_log off;
# Buffer log writes to speed up IO. access_log /var/log/nginx/access.log main buffer=16k;
# The effective method, used on Linux 2.6+, optmized to serve many clients with each thread. use epoll;
# Accept as many connections as possible, after nginx gets notification about a new connection. multi_accept on;
# Caches information about open FDs, freqently accessed files. open_file_cache max=200000 inactive=20s; open_file_cache_valid 30s; open_file_cache_min_uses 2; open_file_cache_errors on;
# Sendfile copies data between one FD and other from within the kernel. sendfile on;
# Causes nginx to attempt to send its HTTP response head in one packet, instead of using partial frames. tcp_nopush on;
# Don't buffer data-sends (disable Nagle algorithm). tcp_nodelay on;
# Timeout for keep-alive connections. Server will close connections after this time. keepalive_timeout 30; # Number of requests a client can make over the keep-alive connection. keepalive_requests 1000;
# Allow the server to close the connection after a client stops responding. reset_timedout_connection on;
# Send the client a "request timed out" if the body is not loaded by this time. client_body_timeout 10; # If the client stops reading data, free up the stale client connection after this much time. send_timeout 2;
# Compression. gzip on; gzip_min_length 10240; gzip_proxied expired no-cache no-store private auth; gzip_types text/plain text/css text/xml text/javascript application/x-javascript application/xml; gzip_disable "msie6";
# This number should be, at maximum, the number of CPU cores on your system. worker_processes 24; # Number of file descriptors used for Nginx. worker_rlimit_nofile 200000; # Only log critical errors. error_log /var/log/nginx/error.log crit events { # Determines how many clients will be served by each worker process. worker_connections 4000; # The effective method, used on Linux 2.6+, optmized to serve many clients with each thread. use epoll; # Accept as many connections as possible, after nginx gets notification about a new connection. multi_accept on; } http { # Caches information about open FDs, freqently accessed files. open_file_cache max=200000 inactive=20s; open_file_cache_valid 30s; open_file_cache_min_uses 2; open_file_cache_errors on; # Disable access log altogether. access_log off; # Sendfile copies data between one FD and other from within the kernel. sendfile on; # Causes nginx to attempt to send its HTTP response head in one packet, instead of using partial frames. tcp_nopush on; # Don't buffer data-sends (disable Nagle algorithm). tcp_nodelay on; # Timeout for keep-alive connections. Server will close connections after this time. keepalive_timeout 30; # Number of requests a client can make over the keep-alive connection. keepalive_requests 1000; # Allow the server to close the connection after a client stops responding. reset_timedout_connection on; # Send the client a "request timed out" if the body is not loaded by this time. client_body_timeout 10; # If the client stops reading data, free up the stale client connection after this much time. send_timeout 2; # Compression. gzip on; gzip_min_length 10240; gzip_proxied expired no-cache no-store private auth; gzip_types text/plain text/css text/xml text/javascript application/x-javascript application/xml; gzip_disable "msie6"; }
Source: https://habr.com/ru/post/198982/
All Articles