From unknown Sun Jun 22 07:25:49 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#56783 <56783@debbugs.gnu.org> To: bug#56783 <56783@debbugs.gnu.org> Subject: Status: [PATCH] services: nginx: Add support for extra content before server blocks. Reply-To: bug#56783 <56783@debbugs.gnu.org> Date: Sun, 22 Jun 2025 14:25:49 +0000 retitle 56783 [PATCH] services: nginx: Add support for extra content before= server blocks. reassign 56783 guix-patches submitter 56783 typ22@foxmail.com severity 56783 normal tag 56783 patch thanks From debbugs-submit-bounces@debbugs.gnu.org Tue Jul 26 11:29:54 2022 Received: (at submit) by debbugs.gnu.org; 26 Jul 2022 15:29:54 +0000 Received: from localhost ([127.0.0.1]:54203 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oGMVJ-0005OZ-Cf for submit@debbugs.gnu.org; Tue, 26 Jul 2022 11:29:54 -0400 Received: from lists.gnu.org ([209.51.188.17]:34748) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oGKIf-0006iD-K2 for submit@debbugs.gnu.org; Tue, 26 Jul 2022 09:08:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44634) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oGKIe-0005sE-UD for guix-patches@gnu.org; Tue, 26 Jul 2022 09:08:37 -0400 Received: from out162-62-57-210.mail.qq.com ([162.62.57.210]:44105) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oGKIW-00008m-Hr for guix-patches@gnu.org; Tue, 26 Jul 2022 09:08:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foxmail.com; s=s201512; t=1658840895; bh=16POmHzLZGTV9RbULOmzvyhJ6qFn54i8S9vzWnhEj+E=; h=From:To:Cc:Subject:Date; b=gl80PxtgkVDhefLe3eoRb48T+R5EcdI74oQ8ILUMpLKjMuds/4VD3gusBxaFluisk C9HuzfNf1x7csUj8b1a+FORLMQ2bF7Se9oFPI2tb3H8wG5vWm+07v7GxCt0hLhnHln sP4rYmG5rcUZLhmgwXxcThxDXVX7TNocR+QTJzD8= Received: from tt-arch.localdomain ([240e:398:28a7:e711:47ea:6145:f832:d560]) by newxmesmtplogicsvrsza30.qq.com (NewEsmtp) with SMTP id 1C3A0076; Tue, 26 Jul 2022 21:07:03 +0800 X-QQ-mid: xmsmtpt1658840823ta93p3o8d Message-ID: X-QQ-XMAILINFO: MFWpArBVhhGTF9nJvQwdUH68M2FanVIFpQLpyRzIsrajFegu0J9qagSfDgHsW9 M3qwpeTmLWqIZt95dZlYXl5qL56OXjUcOX9eTNrn/8z3b/1c3MJ8CVCloNddIVJ5S10EGsXjJnZt wOkVgBnloJ8iZ/Lkm4I+xM93eKSF/EhKNgSVare9U14o5mQ6WcUCyIJHVaAKTLYNHuWKeE5SJoxA C5vvpYZiqne3jhaKmDUB9mNIaHhNn4aE6BRIeWgsolhqVBPKbiL+yQHFcwu7DjfYOXI9jAzZPRg1 5324TUXn8zJbRT6Mo7VUsIYUszYfUvThAXEs5Wtp7nw5AtMYbW0rLxHhB6IiZ0LO920OwP+vlAu+ d3nUv4BpUc566ZgSUbEc0LsE/J9XrcOSTxUNDVjDwjZ31MT1YK1l6WR93fytoygO5TaKmJXT9mL0 pIcZNefx/N23qKGQgV8H7xHJ4uGKv6ntNpH/Yt7usCbOyEoSPwUI98pcxjY+foZWI0EFNh64WTxz 7hHDtanyTD4nQaylff/A2EXCnUSBt47i2lbTzBb5rRXBetSIliBeKawwEDzo3FU7CvptyCadeZpy aYfAJ1NHHO+Mxmj3qx2elFSUnlFTzP4cwxdsHS06U+3IQyjc2zuZtPxyqLk4MFKfLUIouGsQBGlU 4rcaKl4HYSBL4jGZ4c9C39vk9A0wZzKXXdAJW05qA9PWrH+gAfVsvTvl+c80lQ0TM6eTVSZPTElN jN7drgFUw2lDGkwTwWhYTi431dA9RyHoGWmHFJ9NHC32Xl6HEsMejzt2U+um++RF/OovTdyrUlRx oHslzJBWODtfBaisdjvZqHR6TJQEnZsVUGLbWHGXYKNenQ/5NL/Af0rx9C5UN5jjE+gQt9Y/wMif vXAB/40zGBb01p0ULSdeptyC9W204NFunKn3h0/pSdJW/n7LVrKSEetxKiLSHGrOq9gCsfsdwUcb j4xDzXWX4= From: typ22@foxmail.com To: guix-patches@gnu.org Subject: [PATCH] services: nginx: Add support for extra content before server blocks. Date: Tue, 26 Jul 2022 21:06:07 +0800 X-OQ-MSGID: X-Mailer: git-send-email 2.37.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=162.62.57.210; envelope-from=typ22@foxmail.com; helo=out162-62-57-210.mail.qq.com X-Spam_score_int: 11 X-Spam_score: 1.1 X-Spam_bar: + X-Spam_report: (1.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, HELO_DYNAMIC_IPADDR=1.951, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, RDNS_DYNAMIC=0.982, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.5 (/) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Tue, 26 Jul 2022 11:29:47 -0400 Cc: tiantian X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.0 (---) From: tiantian Solve problems like log_format. * gnu/services/web.scm (nginx-configuration-extra-content-ahead): New procedure. (nginx-configuration): Add the extra-content-ahead field. (default-nginx-config): Include the extra-content-ahead. * doc/guix.texi: Add document about extra-content-ahead. --- doc/guix.texi | 3 +++ gnu/services/web.scm | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/doc/guix.texi b/doc/guix.texi index 12ecc1b952..83cf86c8f4 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -28696,6 +28696,9 @@ Web Services Extra content for the @code{http} block. Should be string or a string valued G-expression. +@item @code{extra-content-ahead} (default: @code{""}) +Like extra-content, but it's located at upstream blocks and server blocks. + @end table @end deffn diff --git a/gnu/services/web.scm b/gnu/services/web.scm index f0c7e90cbf..30f9688988 100644 --- a/gnu/services/web.scm +++ b/gnu/services/web.scm @@ -101,6 +101,7 @@ (define-module (gnu services web) nginx-configuration-server-names-hash-bucket-max-size nginx-configuration-modules nginx-configuration-global-directives + nginx-configuration-extra-content-ahead nginx-configuration-extra-content nginx-configuration-file @@ -575,6 +576,8 @@ (define-record-type* (default #f)) (lua-package-cpath nginx-lua-package-cpath ;list of file-like (default #f)) + (extra-content-ahead nginx-configuration-extra-content-ahead + (default "")) (extra-content nginx-configuration-extra-content (default "")) (file nginx-configuration-file ;#f | string | file-like @@ -691,6 +694,7 @@ (define (default-nginx-config config) global-directives lua-package-path lua-package-cpath + extra-content-ahead extra-content) (apply mixed-text-file "nginx.conf" (flatten @@ -734,6 +738,8 @@ (define (default-nginx-config config) ";\n") "") "\n" + extra-content-ahead + "\n" (map emit-nginx-upstream-config upstream-blocks) (map emit-nginx-server-config server-blocks) extra-content -- 2.37.1 From debbugs-submit-bounces@debbugs.gnu.org Tue Jul 26 14:18:31 2022 Received: (at 56783) by debbugs.gnu.org; 26 Jul 2022 18:18:31 +0000 Received: from localhost ([127.0.0.1]:54393 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oGP8Y-0002Nn-Rj for submit@debbugs.gnu.org; Tue, 26 Jul 2022 14:18:31 -0400 Received: from out203-205-221-202.mail.qq.com ([203.205.221.202]:42663) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oGP8U-0002NQ-Ao for 56783@debbugs.gnu.org; Tue, 26 Jul 2022 14:18:29 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foxmail.com; s=s201512; t=1658859496; bh=Kayz3gLiaLet0Tylbu1CUTgJ3m5YczU7bO/boxqRq2w=; h=From:To:Cc:Subject:Date; b=AGqAq6AgzU/S7QO2VbUEw6/i9215HLFeH6320bUVxx2iBl+Y2QiSIJZNeNNzVJi+k 2Mm8Q3OhDALPMuCfl01/GNw6LQlfPZzv7OTSeHSDzO5oSpnsJhlsETKw/Y12lt854t SpN2wJci8x77IfG0OhWaGCO9p+IOI6rP7vGTk394= Received: from tt-arch.localdomain ([240e:398:28a7:e711:47ea:6145:f832:d560]) by newxmesmtplogicsvrsza7.qq.com (NewEsmtp) with SMTP id 48F25057; Wed, 27 Jul 2022 02:18:15 +0800 X-QQ-mid: xmsmtpt1658859495t7ddzsls4 Message-ID: X-QQ-XMAILINFO: Mm0jDPjQYDdlzlusw50D45GN/0I8VFWP56sQV4eLXQnP2xpQ05r2a9+rdkgXSb 7c2H+Rn6XAf5jdzQ3HwSG1rYyY8ptQRxXMqvKC6357huVeB/uhgbTYyZRORb2CZPUGtOoPD5eIpT VvXd0b54CAPtE6sGHjbyOwtZBt4q4HTAUKpgMokvGB/YgnKNGjyGv8PM6ooaXEi2VEzcuD1Xh0SR m9K3tMt1mHSgWNAWelOJeqqCaW2kQLpxy2zk7Ca0XHoQE6Z2WbtBkvXe8ZNv33fxPF/77ZZAB1Is cYe8rTH6xF9wLrzYI9uEEIc59pQoApTgEZM9U7ogo2oGd3Ovu4XU4NJqlhd+9Mg4gEQmHQ3vZrbA w6w4NQFHTZ7fRessdaGUj1mtxuL7/hZcFplactrdeGN07XOKBTgX0cvpp1hXDchOrD7HTZXWtWDh lVU1fBOoZKKhqWfVQJevnWYnMk1yG6YtFeAPUYCL3ki5CGCNfaeLl6uI1FB98pMPpcKZwie58lnF ZOcO3R5to/bGUg/deVuBh3/0dZbiNwS6j5V9L435Pbs9RdODAVeh4js6wGzF7MDamKkiGPJYAUW6 v8xl+4zlxtk0QDGzveZ0vx3t7LWNYiBAAQ69908zbRKDyfSDMuZZPZ4EnyFV8c0ePCjtZPgOTSLZ ays+wjsSAFt1Da4A6KJvfIlGAEUoyIPDTs7NrN0jRBLhLL7aaKO//yQ7dhh4/ElcfhqoHPAY0MuE Y/av51hEqrPS4sSJvcn0A4ds9V8h8JyFAAm0mDButoePXG24RhXnsjh0epW9YSnWVUlLqWDhwSOd PAQkvGFBIRid2o4ZMz94fHMRFvlJNQL9UrmeU3qgb7OYK0gcY6kwvZLA2sKfNIHbEwLTI/MyA9l5 sw2IA3/TDc8dCdntIQELJp5/kcSolaSZRqvSAG0t8oLRqf1yKqX6xP0qeus9eWgcshVDRfVfJl From: typ22@foxmail.com To: 56783@debbugs.gnu.org Subject: [PATCH] doc: fix description for extra-content-ahead Date: Wed, 27 Jul 2022 02:07:23 +0800 X-OQ-MSGID: <593864d0507dc12f4079ebd6631d25db8c0aed81.1658853758.git.typ22@foxmail.com> X-Mailer: git-send-email 2.37.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 3.9 (+++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: From: tiantian Hello, After reading other people's patch emails, I was surprised to find that I can write common messages. Before, I thought I had to follow the format of commit logs. Content analysis details: (3.9 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [203.205.221.202 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (typ22[at]foxmail.com) 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit (typ22[at]foxmail.com) -0.0 SPF_PASS SPF: sender matches SPF record 0.4 RDNS_DYNAMIC Delivered to internal network by host with dynamic-looking rDNS 3.2 HELO_DYNAMIC_IPADDR Relay HELO'd using suspicious hostname (IP addr 1) X-Debbugs-Envelope-To: 56783 Cc: tiantian X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 2.9 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: From: tiantian Hello, After reading other people's patch emails, I was surprised to find that I can write common messages. Before, I thought I had to follow the format of commit logs. Content analysis details: (2.9 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [203.205.221.202 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (typ22[at]foxmail.com) 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit (typ22[at]foxmail.com) -0.0 SPF_PASS SPF: sender matches SPF record 0.4 RDNS_DYNAMIC Delivered to internal network by host with dynamic-looking rDNS 3.2 HELO_DYNAMIC_IPADDR Relay HELO'd using suspicious hostname (IP addr 1) -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager From: tiantian Hello, After reading other people's patch emails, I was surprised to find that I can write common messages. Before, I thought I had to follow the format of commit logs. Sorry, due to my first time sending a patch, tension and poor English lead to guix.texi is wrong. I'm so sorry. The original purpose of this patch is to solve the problem that log_format can't used, when we don't use an existing file. log_format must be placed in http block and before using it. Current nginx-configuration can't meet this requirement. Honestly, just to solve the problem, adding log-formats field may be enough. But, I don't think there is only one problem that log_format can't be used. I think there may be other directives like log_format can't be used. So, I add a field to place extra content before server blocks and upstream blocks. It is simple and flexible. I am a novice, whether using nginx or submitting patches. If I make mistakes, please correct me, thank you. Thanks, tiantian * doc/guix.texi(Web Services): Correct the description of extra-content-ahead in nginx-configuration. --- doc/guix.texi | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/guix.texi b/doc/guix.texi index 83cf86c8f4..b5e17564d4 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -28697,7 +28697,8 @@ Web Services valued G-expression. @item @code{extra-content-ahead} (default: @code{""}) -Like extra-content, but it's located at upstream blocks and server blocks. +Like @code{extra-content} above, but it's located at ahead of +@code{upstream-blocks} and @code{server-blocks}. @end table @end deffn -- 2.37.1