[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

01/01: services: nginx: Support extra content in the http block.

From: Christopher Baines
Subject: 01/01: services: nginx: Support extra content in the http block.
Date: Tue, 12 Jun 2018 16:18:37 -0400 (EDT)

cbaines pushed a commit to branch master
in repository guix.

commit 25e071ead9ddf701485750eec41fd869e310eab0
Author: Christopher Baines <address@hidden>
Date:   Fri Feb 16 18:19:42 2018 +0000

    services: nginx: Support extra content in the http block.
    This helpful when adding content to the nginx configuration file, which 
    supported by the record type used for the configuration.  For example, like
    adding proxy_cache_path configuration.
    * gnu/packages/web.scm (<nginx-configuration>): Add new extra-content field.
      (nginx-configuration-extra-content): New field accessor.
      (default-nginx-config): Add support for the extra-content field.
    * doc/guix.texi (NGINX): Document the new extra-content field.
 doc/guix.texi        | 4 ++++
 gnu/services/web.scm | 9 +++++++--
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index 13b42f5..e734147 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -15938,6 +15938,10 @@ use the size of the processors cache line.
 @item @code{server-names-hash-bucket-max-size} (default: @code{#f})
 Maximum bucket size for the server names hash tables.
address@hidden @code{extra-content} (default: @code{""})
+Extra content for the @code{http} block.  Should be string or a string
+valued G-expression.
 @end table
 @end deffn
diff --git a/gnu/services/web.scm b/gnu/services/web.scm
index aae2f3d..9a58eff 100644
--- a/gnu/services/web.scm
+++ b/gnu/services/web.scm
@@ -77,6 +77,7 @@
+            nginx-configuration-extra-content
@@ -431,6 +432,8 @@
                                  (default #f))
                                      (default #f))
+  (extra-content nginx-configuration-extra-content
+                 (default ""))
   (file          nginx-configuration-file         ;#f | string | file-like
                  (default #f)))
@@ -521,7 +524,8 @@ of index files."
                 (nginx log-directory run-directory
                  server-blocks upstream-blocks
-                 server-names-hash-bucket-max-size)
+                 server-names-hash-bucket-max-size
+                 extra-content)
    (apply mixed-text-file "nginx.conf"
            "user nginx nginx;\n"
@@ -550,7 +554,8 @@ of index files."
            (map emit-nginx-upstream-config upstream-blocks)
            (map emit-nginx-server-config server-blocks)
-           "}\n"
+           extra-content
+           "\n}\n"
            "events {}\n"))))
 (define %nginx-accounts

reply via email to

[Prev in Thread] Current Thread [Next in Thread]