unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#56783] [PATCH] services: nginx: Add support for extra content before server blocks.
@ 2022-07-26 13:06 typ22
  2022-07-26 18:07 ` [bug#56783] [PATCH] doc: fix description for extra-content-ahead typ22
  0 siblings, 1 reply; 2+ messages in thread
From: typ22 @ 2022-07-26 13:06 UTC (permalink / raw)
  To: 56783; +Cc: tiantian

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





^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [bug#56783] [PATCH] doc: fix description for extra-content-ahead
  2022-07-26 13:06 [bug#56783] [PATCH] services: nginx: Add support for extra content before server blocks typ22
@ 2022-07-26 18:07 ` typ22
  0 siblings, 0 replies; 2+ messages in thread
From: typ22 @ 2022-07-26 18:07 UTC (permalink / raw)
  To: 56783; +Cc: tiantian

From: tiantian <typ22@foxmail.com>

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





^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-07-26 18:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-26 13:06 [bug#56783] [PATCH] services: nginx: Add support for extra content before server blocks typ22
2022-07-26 18:07 ` [bug#56783] [PATCH] doc: fix description for extra-content-ahead typ22

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).