From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 37351159C96 for ; Mon, 29 Jul 2024 21:55:09 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id DF2722BC12D; Mon, 29 Jul 2024 21:52:53 +0000 (UTC) Received: from mail-ed1-x533.google.com (mail-ed1-x533.google.com [IPv6:2a00:1450:4864:20::533]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id B05DE2BC128 for ; Mon, 29 Jul 2024 21:52:53 +0000 (UTC) Received: by mail-ed1-x533.google.com with SMTP id 4fb4d7f45d1cf-5b214865fecso1956167a12.1 for ; Mon, 29 Jul 2024 14:52:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1722289972; x=1722894772; darn=lists.gentoo.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=pQVmq6wksFTGXSBfBAc3OnOid2JhGAfv4a1N1f6dj6Q=; b=kRX9te9pOCBaQGqxnppkgM+K5Llrc9VDD5LyzPIxXi+4v8HqL/zjq52b/sDIwUqW8G D+NpckgOPi1qAt/Gnh8NrXx3eec1F6vr/RIVPV7iBNOKOYixCKBX0apPzZLhHRk/7n8/ W4nGC1s1X+yZUrf+OUQUpX0HqimilcZ6zn0cCcZGjJBCP2+HD8FrbNMhUKzP/4d/VeEi B20dzsGP2xcPjdDQb7hFuStrqFXExvBztvWB7unLjci739QxmKG8/QWRvORseLU4zR80 +xn8dryLs60ZkFgUc5IXU7top4AMW2js3fr4ZwbCClU5TO1b6hLMmITSfk7Ejcqnpi74 Z1ug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722289972; x=1722894772; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=pQVmq6wksFTGXSBfBAc3OnOid2JhGAfv4a1N1f6dj6Q=; b=o1NTng7F7WlGEPOjHm/9HD3uniS9m2tdyhksjUVsubp30nJffnRSHxiK3RW4BuXH/i 6L1aOygkALNsoPqN2xFhs8vR8ez1u9ZYkClFBCkmUghQ4WeiWpyBmA0BuG186ZqRS35q otiXd4px43+nLOSCuFCQ8S0YH36UMB7Zvg9k4AqD/T7B7O3xmaVOihyrdggHTXFniu4a Ulb/+VL6Wg+sSW/9krJnKh25DjlnbsRK3GLf48ggi/AheZvuDvtQSuPoDTnbrjGq1/MS MaqRNIwEG3STIqfUsEh3GOTEC/sFGhhJ5q3s7QftinsTj46FKqXhS1t/5xQhIyyPNtMq ZKsQ== X-Gm-Message-State: AOJu0YxO+62cOtb5WnHisy5VcRThNGygLUBAGR5h7FYs7cIdT0jefaz5 O3GsAucICdAs0j+UDPsfpQZzwoisejXyTYqo0lbKKoSqAaCX0OMV+WD+7w== X-Google-Smtp-Source: AGHT+IGHFL+jYULWWQw21BCXfoc7XPfm4rxxJ4N3Ygapupk7fPlLT5dF0nUem5cbWZn0uLZhvxkW+g== X-Received: by 2002:a17:907:7d92:b0:a7a:b9dd:775b with SMTP id a640c23a62f3a-a7d40165ee5mr641222066b.53.1722289972126; Mon, 29 Jul 2024 14:52:52 -0700 (PDT) Received: from localhost.localdomain ([62.244.50.57]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a7acad9046fsm564748266b.147.2024.07.29.14.52.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Jul 2024 14:52:51 -0700 (PDT) From: Zurab Kvachadze To: gentoo-dev@lists.gentoo.org Cc: conikost@gentoo.org, Zurab Kvachadze Subject: [gentoo-dev] [RFC PATCH v2 09/20] www-servers/nginx: add nginx-r4.conf Date: Tue, 30 Jul 2024 00:52:25 +0300 Message-ID: <20240729215241.13243-10-zurabid2016@gmail.com> X-Mailer: git-send-email 2.44.2 In-Reply-To: <20240729215241.13243-1-zurabid2016@gmail.com> References: <20240729215241.13243-1-zurabid2016@gmail.com> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Archives-Salt: afe2e76a-4adb-40a6-b38b-34b3a685549a X-Archives-Hash: 9425e7ebb612fb8566ce7963794d2afd This is the fourth revision of the main configuration file of NGINX. Thank you Torbjörn Lönnemark for reporting this! This revision brings a lot of changes, mainly in terms of removed directives (and yes, I will quote Torbjörn Lönnemark on this): * worker_processes "1" -> "auto": it makes no sense to cap the number of worker processes at 1, this commit makes the NGINX spawn as many worker processes as there are CPU cores. * remove "worker_connections 1024": 512 is the default value, no reason to increase. * remove "use epoll": NGINX already uses the most efficient polling method available by default, no need to specify it explicitly. Additionally, NGINX may even fail to start if epoll() is unavailable on the system. * remove "default_type application/octet-stream": arbitrary setting with no obvious purpose, in some circumstances may even be harmful, considering that the default value for this directive is "text/plain". * remove custom "log_format": needlessly diverges from the default format, quoting Torbjörn Lönnemark: > The only difference between this and the builtin 'combined' format > is that it includes gzip_ratio, and gzip is disabled by default > anyway. Can be removed while additionally replacing 'main' in the > access_log directives to 'combined' * remove "connection_pool_size 256", "client_header_buffer_size 1k" and "large_client_header_buffers 4 2k": the connection_pool_size directive sets the default value on 32-bit machines and overrides the default value on 64-bit machines, client_body_buffer_size is 8 times less than the default value, the same applies to large_client_header_buffers. * remove "request_pool_size 4k", "gzip off", "tcp_nodelay on", "ignore_invalid_headers on", "index index.html": they restate the defaults. * remove "client_header_timeout 10m", "client_body_timeout 10m", "send_timeout 10m", "output_buffers 1 32k", "postpone_output 1460", "tcp_nopush off", "keepalive_timeout 75 20": the directives override the defaults with no clear intent. The "server" blocks have also been reworked. Due to www-servers/nginx not installing anything into /var/www/localhost/htodcs, the root directory for the default server will almost always be empty. Therefore, the plaintext example server has had its "root" directive commented out. For the SSL server, the removed-since-1.25.1 "ssl" directive has been changed into an argument to the "listen" directive, as prescribed upstream. Bug: https://bugs.gentoo.org/928131 Bug: https://bugs.gentoo.org/576414 Reported-by: Torbjörn Lönnemark Signed-off-by: Zurab Kvachadze --- www-servers/nginx/files/nginx-r4.conf | 39 +++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 www-servers/nginx/files/nginx-r4.conf diff --git a/www-servers/nginx/files/nginx-r4.conf b/www-servers/nginx/files/nginx-r4.conf new file mode 100644 index 000000000000..1144af3d7ceb --- /dev/null +++ b/www-servers/nginx/files/nginx-r4.conf @@ -0,0 +1,39 @@ +user nginx nginx; +worker_processes auto; + +events { + # NGINX refuses to start if the 'events' section is not present. Yet, + # NGINX does not seem to care whether this section is non-empty. +} + +http { + # Maximum hash table size is increased to accommodate for a large + # mime.types file that is shipped on Gentoo. + types_hash_max_size 4096; + include /etc/nginx/mime.types.nginx; + + sendfile on; + + # Example server. Warning: by default, the /var/www/localhost directory is + # NOT created; for the following configuration block to work, the + # directory must be created manually. + server { + listen 127.0.0.1; + server_name localhost; + + # Substitute the directory below for the one you use. + #root /var/www/localhost/htdocs; + } + + # SSL server example. + #server { + #listen 127.0.0.1:443 ssl; + #server_name localhost; + + #ssl_certificate /etc/ssl/nginx/nginx.pem; + #ssl_certificate_key /etc/ssl/nginx/nginx.key; + + #root /var/www/localhost/htdocs; + #} + +} -- 2.44.2