From patchwork Sun Oct 6 15:40:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomas Volf <~@wolfsden.cz> X-Patchwork-Id: 68639 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id E6D1C27BBE2; Sun, 6 Oct 2024 16:41:18 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-7.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_ADSP_ALL,DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H2,RCVD_IN_VALIDITY_CERTIFIED, RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE,SPF_HELO_PASS autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 8B8D627BBE9 for ; Sun, 6 Oct 2024 16:41:17 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sxTNT-0005tS-Sy; Sun, 06 Oct 2024 11:40:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sxTNQ-0005tG-5b for guix-patches@gnu.org; Sun, 06 Oct 2024 11:40:56 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sxTNP-0001w2-UC for guix-patches@gnu.org; Sun, 06 Oct 2024 11:40:55 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:From:To:In-Reply-To:References:Subject; bh=+FRdTheEiHAvclW4LoNmuBGaKbf+lfUtB5Ge96BQ58c=; b=Z/PjoFJ8eWA+NF56iyNRPb+Q5IXDXQDj4AoTaYWE16EoOzhU1M8LcbZaTv8o1wy/GUQTYpccnwi53+AhGiTSb8gOXqb8jgms/yGf/wiVhE5QEHl3MPyDN7H5mO1Raj1QA8vFl6K/NomVzOCA9zE8t/F3RZSFREW7AXstEqYxY3DvJG9rD8vJY4+6Z3iHPfSEDxvNOA0PQdYKmOvwll0jzPtMJ5KH8NjGQeKZpmriUyxePyQsQ5332F5eUhekHRqE0OvBhvZVY/wwDppullFyfvblQpVUgZjNR76ZmeEL9bHBaKLnnzSGXFEPh96tYJ5xZqEwcjN/0nzGqShqQ2CbHg==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sxTNV-0000E5-O3 for guix-patches@gnu.org; Sun, 06 Oct 2024 11:41:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#71673] [PATCH v2] services: nginx: Print extra-content before the server-blocks. References: In-Reply-To: Resent-From: Tomas Volf <~@wolfsden.cz> Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 06 Oct 2024 15:41:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 71673 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 71673@debbugs.gnu.org Cc: Tomas Volf <~@wolfsden.cz> Received: via spool by 71673-submit@debbugs.gnu.org id=B71673.1728229239827 (code B ref 71673); Sun, 06 Oct 2024 15:41:01 +0000 Received: (at 71673) by debbugs.gnu.org; 6 Oct 2024 15:40:39 +0000 Received: from localhost ([127.0.0.1]:41976 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sxTN8-0000DH-Jr for submit@debbugs.gnu.org; Sun, 06 Oct 2024 11:40:38 -0400 Received: from wolfsden.cz ([37.205.8.62]:60422) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <~@wolfsden.cz>) id 1sxTN4-0000D2-UT for 71673@debbugs.gnu.org; Sun, 06 Oct 2024 11:40:36 -0400 Received: by wolfsden.cz (Postfix, from userid 104) id 6BDEB31D0EF; Sun, 6 Oct 2024 15:40:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=wolfsden.cz; s=mail; t=1728229227; bh=VT8lJU2CP5w3v8ifCHxlv5WCcr70nJo69yzY74Qjk+g=; h=From:To:Cc:Subject:Date; b=lRWQBI3G7fLji0vOG0X+TviDJQxvK+jCrwhrr8gpwP6c6253syBxJL7jd4xpFEgvR QsMEioRDv0Oh9cdgl/5+bezKvk5ulKnN3fTkMLl2kze1wVvalMcTe3Q28EKbRBmhaw G/srEydPKz83LpoiZ9w560znmwnu7UQ/tGX5StZyhQzIhsCk+CISOcgN3foOEPeSXz 3s3IdknxU4nfy5cSXCK6Nuzs0nik++VebIKzicxp7bfoXMLj+fd3o5sbOgKXqPjtQ8 xLWPMA2k5XHq65U5tPicuDX5/EKqdhpxMo+WsAVZJ/5VKhWdXj0TA9KyNcDR4qJqA4 65eEu2WxBAqKnE+Fdt0N/B4Q4bsoyxnqJhIjc1iW+68+ve6sw7qbhopMUwd4MoDrkG VjoN/UphmHDLQzBmCslZ27dxItBYhS1lWVJD8bVMVMKNnR4nN3a8GSvwPrgaE07bdG G8Z1ngZS24+IskdOe4AQI3OfpJevKTbli3NQN2Nu5EMFsz6fb0Vv0WRItqz7tnUXbc FH9ituzJ+OJvZg5yGM23ocKHeMWRm8b0FytXlBpVkl5QfjrtFomZwjP3Vj4s1/2VSa +zNdRwfrVMzKZgS6FCGk4K67ePX6SHrETOxcZ9IK00YOcCYPdFBbExEtnN0/SvLnwy 5DUExRDnhFImP652KtOXbxqc= Received: from localhost (unknown [146.70.134.132]) by wolfsden.cz (Postfix) with ESMTPSA id 8483431EB9C; Sun, 6 Oct 2024 15:40:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=wolfsden.cz; s=mail; t=1728229226; bh=VT8lJU2CP5w3v8ifCHxlv5WCcr70nJo69yzY74Qjk+g=; h=From:To:Cc:Subject:Date; b=DXJWLRMx+3WYmJtPVrUC8J6NBJJtu3icuSjrJut62Xlh9RxPleWkTmgNY9WVbxNah 3k/fk5jAMUVQZfTmhA74PmCXHF2Qyy4UXrZQpDnjXh2vljTJpEDXXeVFRyVPYjuzN0 ZY2o+BT5geQetM7c+Iv/heKnY4He7t7CuTy78FwxugMOkRdTKaWeVfnyUm+1hUryYJ iX2jwZQxjJ4yqZE34HtAMXZsQOi7JkxWm71I5IXoeUHtEnJLUF6zRKfkWvIN+l0t5O WbMjjps0v6M3Cgotal9FoT0x75vUgN7+ram5oEE9IKbWE7YpuKoTfE3jOY12GkSneX rJz/2dTzyPN0Evd0tg8jM/qUlPnzxQ9BIDKXJQhqmujsX1s9s4E/5chItvNMHqgW6r HSzzXlpi0TBlgnukbaLlb1O1BL7HkyVc+uYZ4JKoSvwHp491g0MmS8knA3MjpKSAsy xiwSQbyAWy7sDdVn1XZP2MbwlDQcGawY9CCmPVS7iP2nXgkLHsl0uZv7K1K8O7PMmd OJjI8XKkQ7M7BGaKFKmTz8LIWZCf9skFooRZIJoIQyoMSaPAOK85stiEB7yMJ/2PTE d/JGZ829LUHj/maqvMbfd5HCiI80RJ+A2/1MAb7vyfU0O3Th8yOKitnYcEEBZrVueU eg+Qp/rkzqGP4qPbIORgVZuk= From: Tomas Volf <~@wolfsden.cz> Date: Sun, 6 Oct 2024 17:40:14 +0200 Message-ID: X-Mailer: git-send-email 2.46.0 MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches The configuration file is processed sequentially, which meant that there was no way to set for example log format shared between the server-blocks, because the final configuration file would have this order: ... http { ... server { } ... $extra-content } Moving the extra-content before the serialization of server-blocks resolves this. * gnu/services/web.scm (default-nginx-config): Move extra-content before server-blocks. Change-Id: Ie8286a533dfed575abc58a0f4800706b3ad6adc2 --- Rebase on latest master. gnu/services/web.scm | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) -- 2.46.0 diff --git a/gnu/services/web.scm b/gnu/services/web.scm index cc6f4e6d9b..84ce88aa80 100644 --- a/gnu/services/web.scm +++ b/gnu/services/web.scm @@ -770,10 +770,7 @@ (define (default-nginx-config config) (number->string server-names-hash-bucket-max-size) ";\n") "") - "\n" - (map emit-nginx-upstream-config upstream-blocks) - (map emit-nginx-server-config server-blocks) - (match extra-content + (match extra-content ((? list? extra-content) (map (lambda (line) `(" " ,line "\n")) @@ -781,7 +778,10 @@ (define (default-nginx-config config) ;; XXX: For compatibility strings and gexp's are inserted ;; directly. (_ extra-content)) - "\n}\n")))) + "\n" + (map emit-nginx-upstream-config upstream-blocks) + (map emit-nginx-server-config server-blocks) + "}\n")))) (define %nginx-accounts (list (user-group (name "nginx") (system? #t))