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 18775158170 for ; Wed, 17 Jul 2024 12:08:42 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 8932A2BC152; Wed, 17 Jul 2024 12:06:06 +0000 (UTC) Received: from mail-lj1-x22a.google.com (mail-lj1-x22a.google.com [IPv6:2a00:1450:4864:20::22a]) (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 377D22BC14F for ; Wed, 17 Jul 2024 12:06:06 +0000 (UTC) Received: by mail-lj1-x22a.google.com with SMTP id 38308e7fff4ca-2eee1384e0aso49504311fa.1 for ; Wed, 17 Jul 2024 05:06:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1721217965; x=1721822765; 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=ivtgHzEIQBhZzd0Y7cKoh0JKBjqSjKEgdm2NIaoP6PnXkcMAiXX6bq2rveJiKkZ7RV lH/enMf2F1A2pXYkOs5d6qqFOD38lnPM75Mphpoov1J26FquoSG/uDBTTGf87pDjaXPU YXnZisQmmYXTIoyNt/Mz4fR4h+t39SNqSv5xoAGYEV6a1BTF25x1pIA3nrNsaduX7gBy ki28HFdgKaK3Ll+7ZDZx4M5UT751Wyao8y4FIfC8IVjCxBcJGeUEPLJx3bDLs8hy9Y/W KUgB6w6SdKhaRjDcigvpIxxlxNAVr5qufs3u5DnLIP4W+7dJM7hVmEahxPPsjdoCQ5sh suZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721217965; x=1721822765; 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=Z3/QWbVG707i/mnOYeR7fciKi4MK8aYYCVdAIWW021zARWEaUJ2aQmViGbHoEdrrhl WlSEkBhsB9Yh1UoADCqsNfVAUWIG1GzbAl8+5ZPuBWY0ZmsaTAMe18RyJXXDjCoMkRc3 o9Zh7fAgzE1sFdzQtVTIeTo/EZ9R6c3IwGgua6VUsQnf6Kw2pzaTYi6u0Sdx5gg+9JXr XeqLTxE3ifD+5etwqRHDx3u0uXHyQYHVbBLaKU4bmULs74UmygNdch3razUWMdb5+6fg /RlbTtpPEwqRke3zPNUqCQKKNT0ntuGpArjEa7+Fpi8BY+bThyZRLVuDm05Yr4YJTQMi rfsQ== X-Gm-Message-State: AOJu0YyGAxFyIEmmeZi9huAx/uZcejpHrSbUBUCRLjTazYC+IgroEPyY iuRSCWufJIF0VqeeMCPkNhB1J+iEQOLgQxLcblhV9nG9HHabUE/Ng/JMiw== X-Google-Smtp-Source: AGHT+IF6Qj3CZSs+g226nZRI4+1/INfbVNzJe71cOzyDL1n/dz5AmqTxUo1ros58pd+yJbxHVxZhJQ== X-Received: by 2002:a2e:a552:0:b0:2ee:7a71:6e3b with SMTP id 38308e7fff4ca-2eefd0bc570mr13569271fa.27.1721217964636; Wed, 17 Jul 2024 05:06:04 -0700 (PDT) Received: from localhost.localdomain ([62.244.50.57]) by smtp.gmail.com with ESMTPSA id 38308e7fff4ca-2eee1914ad5sm14636941fa.79.2024.07.17.05.06.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jul 2024 05:06:04 -0700 (PDT) From: Zurab Kvachadze To: gentoo-dev@lists.gentoo.org Cc: Zurab Kvachadze Subject: [gentoo-dev] [RFC PATCH 08/19] www-servers/nginx: add nginx-r4.conf Date: Wed, 17 Jul 2024 15:05:40 +0300 Message-ID: <20240717120553.31866-9-zurabid2016@gmail.com> X-Mailer: git-send-email 2.44.2 In-Reply-To: <20240717120553.31866-1-zurabid2016@gmail.com> References: <20240717120553.31866-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: 3ac45d96-4bb1-4a9c-98d3-07e8257ca7f8 X-Archives-Hash: b26b666f1dda9d2a1b8946440d6b0414 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