public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
From: Zurab Kvachadze <zurabid2016@gmail.com>
To: gentoo-dev@lists.gentoo.org
Cc: Zurab Kvachadze <zurabid2016@gmail.com>
Subject: [gentoo-dev] [RFC PATCH 08/19] www-servers/nginx: add nginx-r4.conf
Date: Wed, 17 Jul 2024 15:05:40 +0300	[thread overview]
Message-ID: <20240717120553.31866-9-zurabid2016@gmail.com> (raw)
In-Reply-To: <20240717120553.31866-1-zurabid2016@gmail.com>

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 <zurabid2016@gmail.com>
---
 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



  parent reply	other threads:[~2024-07-17 12:08 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-17 12:05 [gentoo-dev] [RFC PATCH 00/19] Rework NGINX packaging in Gentoo by introducing nginx{,-module}.eclass Zurab Kvachadze
2024-07-17 12:05 ` [gentoo-dev] [RFC PATCH 01/19] nginx.eclass: Add new eclass for building the NGINX server Zurab Kvachadze
2024-07-17 12:05 ` [gentoo-dev] [RFC PATCH 02/19] nginx-module.eclass: Add new eclass for building NGINX external modules Zurab Kvachadze
2024-07-17 12:05 ` [gentoo-dev] [RFC PATCH 03/19] www-servers/nginx: add myself as a proxy maintainer; update metadata.xml Zurab Kvachadze
2024-07-17 12:05 ` [gentoo-dev] [RFC PATCH 04/19] www-servers/nginx: add nginx-r5.initd Zurab Kvachadze
2024-07-17 12:41   ` Michael Orlitzky
2024-07-19  9:20     ` Zurab Kvachadze
2024-07-19 10:31       ` Michael Orlitzky
2024-07-19 16:33         ` Zurab Kvachadze
2024-07-17 12:05 ` [gentoo-dev] [RFC PATCH 05/19] www-servers/nginx: add nginx-r1.confd Zurab Kvachadze
2024-07-17 12:05 ` [gentoo-dev] [RFC PATCH 06/19] www-servers/nginx: add nginx-r2.service Zurab Kvachadze
2024-07-20 16:58   ` Alexander Tsoy
2024-07-20 17:15     ` Michael Orlitzky
2024-07-20 17:25       ` Alexander Tsoy
2024-07-20 19:17         ` Alexander Tsoy
2024-07-20 21:07         ` Michael Orlitzky
2024-07-21 21:19           ` Zurab Kvachadze
2024-07-17 12:05 ` [gentoo-dev] [RFC PATCH 07/19] www-servers/nginx: add nginx-r2.logrotate Zurab Kvachadze
2024-07-17 12:05 ` Zurab Kvachadze [this message]
2024-07-17 12:05 ` [gentoo-dev] [RFC PATCH 09/19] profiles/desc: reword and update nginx_modules_http.desc Zurab Kvachadze
2024-07-17 12:05 ` [gentoo-dev] [RFC PATCH 10/19] profiles/desc: reword and update nginx_modules_mail.desc Zurab Kvachadze
2024-07-17 12:05 ` [gentoo-dev] [RFC PATCH 11/19] profiles/desc: reword and update nginx_modules_stream.desc Zurab Kvachadze
2024-07-17 12:05 ` [gentoo-dev] [RFC PATCH 12/19] profiles/categories: Add www-nginx category for external NGINX modules Zurab Kvachadze
2024-07-17 12:05 ` [gentoo-dev] [RFC PATCH 13/19] www-servers/nginx: revbump 1.26.1-r1 to 1.26.1-r2, use nginx.eclass Zurab Kvachadze
2024-07-17 12:05 ` [gentoo-dev] [RFC PATCH 14/19] www-servers/nginx: revbump 1.27.0-r1 to 1.27.0-r2, " Zurab Kvachadze
2024-07-17 12:05 ` [gentoo-dev] [RFC PATCH 15/19] www-servers/nginx: add 9999 live version, " Zurab Kvachadze
2024-07-17 12:05 ` [gentoo-dev] [RFC PATCH 16/19] www-nginx/ngx_devel_kit: new package, add 0.3.3 Zurab Kvachadze
2024-07-17 12:05 ` [gentoo-dev] [RFC PATCH 17/19] www-nginx/ngx-echo: new package, add 0.63 Zurab Kvachadze
2024-07-17 12:05 ` [gentoo-dev] [RFC PATCH 18/19] www-nginx/ngx-encrypted-session: new package, add 0.09 Zurab Kvachadze
2024-07-17 12:05 ` [gentoo-dev] [RFC PATCH 19/19] www-nginx/ngx-set-misc: new package, add 0.33 Zurab Kvachadze

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240717120553.31866-9-zurabid2016@gmail.com \
    --to=zurabid2016@gmail.com \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox