From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id 4Bv4LigP4GKSggAAbAwnHQ (envelope-from ) for ; Tue, 26 Jul 2022 17:58:32 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id UFfyLigP4GLDFgAAauVa8A (envelope-from ) for ; Tue, 26 Jul 2022 17:58:32 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 78AD525342 for ; Tue, 26 Jul 2022 17:58:32 +0200 (CEST) Received: from localhost ([::1]:59902 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oGMx5-0001u1-6c for larch@yhetil.org; Tue, 26 Jul 2022 11:58:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54182) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oGMVW-0004Gf-T6 for guix-patches@gnu.org; Tue, 26 Jul 2022 11:30:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:36222) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oGMVW-0007X8-J3 for guix-patches@gnu.org; Tue, 26 Jul 2022 11:30:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oGMVW-0005Pu-EV for guix-patches@gnu.org; Tue, 26 Jul 2022 11:30:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#56783] [PATCH] services: nginx: Add support for extra content before server blocks. Resent-From: typ22@foxmail.com Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 26 Jul 2022 15:30:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 56783 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 56783@debbugs.gnu.org Cc: tiantian X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.165884939420760 (code B ref -1); Tue, 26 Jul 2022 15:30:02 +0000 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 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-Mailman-Approved-At: Tue, 26 Jul 2022 11:29:47 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Mailman-Approved-At: Tue, 26 Jul 2022 11:58:24 -0400 X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1658851112; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=16POmHzLZGTV9RbULOmzvyhJ6qFn54i8S9vzWnhEj+E=; b=SQVssf/TpSe686RUrON1HWxo4Yfl5fnCjimmrKSmUn+P3Usb9bLd2CgpgEy8hB3UM8IFoK 3dm8jZhD+lZQ30zPqqS4zE3S0t61a3m39V/FOtLETuIh2PHDv+MimSYz/3mjqbcwkH5Ene uJ5hTVi7H+IDjS5UsHFj6rDLFD8LblI56eY463y9tlUqNzeH9Ifq5ip995IjTOhSZChPYi /J1gkAsPcIoRtF4ceFjuzZ3NnSYF63l6bf+GxoXghNzQKh8hoByKrkxEMaiyaHS3Cr4Q5p g0Zv8IdpPtuBb+yNh1m9dCnTP6p6X1UQy/FVqbkHVAfsROFlVmRct9KFk3zKmQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1658851112; a=rsa-sha256; cv=none; b=K7lPxePMXYGthwQoAhm6Ex0+zWDRue4HpOl86UZgbQZ71RLN0M/L/xEJGTfcIq4hN6pnZC 3PTJLRK64Su4vc+z4z3xvHiS+L0Ygq7QVZAM8rQa0U71QYw+eRAF1/qmzIqHuGIP1s55P8 xQMYhWIoaunyjcDIoG+d3avzyOFeKM78HTiUF7zyeZbr7mBuaxMNNpbbfEoalxywly1nFu BtIYtn9zi8RWIFwtkgSyLyJZhj2mKfqJYKbcl54dkD6Qh6puX+K8IfRjZn3wzPAS5C0kvz rxemYL6Zq0ZfxoJ7fmqnvRwzn9AmLleD5GJmI7TGml5R0hbIZEw60Wjw/47eyw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=foxmail.com header.s=s201512 header.b=gl80Pxtg; dmarc=fail reason="SPF not aligned (relaxed)" header.from=foxmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: 10.07 X-Spam: Yes Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=foxmail.com header.s=s201512 header.b=gl80Pxtg; dmarc=fail reason="SPF not aligned (relaxed)" header.from=foxmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 78AD525342 X-Spam-Score: 10.07 X-Migadu-Spam: Yes X-Migadu-Scanner: scn0.migadu.com X-TUID: nFEpPvFJ6vK0 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