all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: typ22@foxmail.com
To: 56783@debbugs.gnu.org
Cc: tiantian <typ22@foxmail.com>
Subject: [bug#56783] [PATCH] services: nginx: Add support for extra content before server blocks.
Date: Tue, 26 Jul 2022 21:06:07 +0800	[thread overview]
Message-ID: <tencent_1368FC0AC6A0059DC1444DF543B5D0146306@qq.com> (raw)

From: tiantian <typ22@foxmail.com>

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* <nginx-configuration>
                     (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





             reply	other threads:[~2022-07-26 15:58 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-26 13:06 typ22 [this message]
2022-07-26 18:07 ` [bug#56783] [PATCH] doc: fix description for extra-content-ahead typ22

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=tencent_1368FC0AC6A0059DC1444DF543B5D0146306@qq.com \
    --to=typ22@foxmail.com \
    --cc=56783@debbugs.gnu.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.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.