events { # The effective method, used on Linux 2.6+, optmized to serve many clients with each thread. use epoll; # Determines how many clients will be served by each worker process. worker_connections 4000; # Accept as many connections as possible, after nginx gets notification about a new connection. multi_accept on; }
http { include /etc/nginx/mime.types; default_type application/octet-stream;
# Allow the server to close the connection after a client stops responding. reset_timedout_connection on; client_header_timeout 15; # 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 15; # 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 30;
# Sendfile copies data between one FD and other from within the kernel. sendfile on; # Don't buffer data-sends (disable Nagle algorithm). tcp_nodelay on; # Causes nginx to attempt to send its HTTP response head in one packet, instead of using partial frames. tcp_nopush on;
# Hide web server information server_tokens off; server_info off; server_tag off;
# redirect server error pages to the static page error_page 404 /404.html; error_page 500 502 503 504 /50x.html;