From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (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 finch.gentoo.org (Postfix) with ESMTPS id 21BD41582EF for ; Fri, 21 Feb 2025 16:20:16 +0000 (UTC) Received: from lists.gentoo.org (bobolink.gentoo.org [140.211.166.189]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: relay-lists.gentoo.org@gentoo.org) by smtp.gentoo.org (Postfix) with ESMTPSA id A10703433D5 for ; Fri, 21 Feb 2025 16:20:09 +0000 (UTC) Received: from bobolink.gentoo.org (localhost [127.0.0.1]) by bobolink.gentoo.org (Postfix) with ESMTP id 0764B11050C; Fri, 21 Feb 2025 16:09:02 +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 bobolink.gentoo.org (Postfix) with ESMTPS id 39045110501 for ; Fri, 21 Feb 2025 16:09:01 +0000 (UTC) Received: by mail-ed1-x533.google.com with SMTP id 4fb4d7f45d1cf-5dec996069aso3667210a12.2 for ; Fri, 21 Feb 2025 08:09:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1740154139; x=1740758939; 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=fw/ynoZDhrs+VY6K0MdE7N5u6WuKmrIrDocp/0NEbws=; b=h9YuqKG+vgN7lilb4cL4buuS3AKXjh7ZWht0b4IV5zfnDhrIJ99LAP49aSAH08hDLp WkuWrsIsvevvR3/TgYNQOYubADaeswsLN6XHR3xjrSwWbMAru64fTp8RDavcqluRDb2V IJs+Tu3j8h9nQGtMxuBpk/hBKZFcKh3FTc5s8ybWcCmh1u2s6L9tagT6/Be/2GrVcCvL xyBGt5arEFzExNROWmx75c8pPMPOEjLr1vgCrQpNQ3Ctrs5nDGRxH7FViqoYpl77RgAv VCte9nl2Nqy8vqVFZ3MRQsXpqDqL33qnWivzjWFme+uhE17S0Asu7ifvqjnmaW1mAsVd x/yg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1740154139; x=1740758939; 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=fw/ynoZDhrs+VY6K0MdE7N5u6WuKmrIrDocp/0NEbws=; b=gXcWNQBkNn2yDPFmA6I9apmFQkBSJLfp71BanlH51cBa5nBnFc3F2ni4JH8g0tRCOs AB7G9CQC4tgWJ6QLD1AVFsk/zg95lN9wYWfhCN4cEF/5vKLLobBmUPV5tNlsiVvkoCg+ ySXsdQ4/aEFNBj4fveq6SpzxXygbcOsrV6WoJwqOsozlODf+CkBC1SEg2+bwQsfj+Fug pqJbfK++S4K7/6b3d5K8fSzbE7R9tu/4gkpULrMCnx5AXEi6x1m7JjTHVtJa7D8EpA7R 0E115DXrttzkobAewySN8gxct/rylPk0ZMmWuhpOkVUoE6tX2MIlHz2TkCCn+oboeCWn lNxg== X-Gm-Message-State: AOJu0YzFpRvDxNa+cj3F4O6wYn81XDHnqlE/0PloyJJhQVydchti4CFc hDz5TdWnUd3GF2kh2zIEASSaeAMp2eAjwm7ilHPH50qpSuTZ6dPE4YjcpZsa X-Gm-Gg: ASbGncvopmR9kFHn4hefsNJFg7sRSHxn2ktkEuQIW4lTSO4bVrPI8stYipti7zZziLS PYcLL9Ee/zHTseriN1XySgfyffrhoa0oZtpFeKRQ1Ifaml7CaC2UitVcb7vMUWAzJrpkxApa3Ey SNAfsdO2Y4LcM8T4oAv/GN9A1NBmwJA9FKIYFiN3/LneSN+H0IqPuUgwKMldnC1k+xqsDjm+Q/6 8QKEAjIy7cmUK+ktZMBTX9T6+lfQItG6YLwCclet64hAdLfJzUzgbmS16+y/Mhqwq8axfnGOa+d mzaA0/FzgQAsXEtipwJerLf4de6oU9cg+eVG7G+xpz7AgEXIZhSHuGSUtJWLI9I12BabwoQGwhs = X-Google-Smtp-Source: AGHT+IGGXgiEH18pkSO0DQDrr4Y14nV4bhVcTHsuDsP5XIhkrgoS3XA+1b7p32njwayPWX0F+O025w== X-Received: by 2002:a17:907:da6:b0:ab7:ca44:feb8 with SMTP id a640c23a62f3a-abc09e57f66mr418055566b.52.1740154139394; Fri, 21 Feb 2025 08:08:59 -0800 (PST) Received: from localhost.localdomain (92-70-146-242.biz.kpn.net. [92.70.146.242]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-abbac781b78sm862154466b.60.2025.02.21.08.08.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Feb 2025 08:08:59 -0800 (PST) From: Zurab Kvachadze To: gentoo-dev@lists.gentoo.org Cc: Zurab Kvachadze Subject: [gentoo-dev] [PATCH v3 12/40] www-servers/nginx: add nginx-r4.conf Date: Fri, 21 Feb 2025 17:08:09 +0100 Message-ID: <20250221160839.29308-13-zurabid2016@gmail.com> X-Mailer: git-send-email 2.45.3 In-Reply-To: <20250221160839.29308-1-zurabid2016@gmail.com> References: <20250221160839.29308-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: 458aa934-e4a0-4217-9126-d2d8648c1b08 X-Archives-Hash: 15900ce7be14de478c1fe05540d10b68 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.45.3