```{index} nginx; nginx.conf ``` # Стандартная настройка nginx.conf ```nginx user nginx; worker_processes auto; error_log /var/log/nginx/error.log crit; pid /var/run/nginx.pid; events { 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; log_format main '$remote_addr - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"'; log_format additional '$remote_addr - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for" ' 'rt=$request_time uct="$upstream_connect_time" ' 'uht="$upstream_header_time" urt="$upstream_response_time"'; access_log /var/log/nginx/access.log main buffer=16k; server_tokens off; # 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_vary on; gzip_min_length 10240; gzip_proxied any; gzip_disable "msie6"; gzip_types # text/html is always compressed by HttpGzipModule text/css text/javascript text/xml text/plain text/x-component application/javascript application/x-javascript application/json application/xml application/rss+xml application/atom+xml font/truetype font/opentype application/vnd.ms-fontobject image/svg+xml; include /etc/nginx/conf.d/*.conf; } ```