unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: "Clément Lassieur" <clement@lassieur.org>
To: 29633@debbugs.gnu.org
Subject: [bug#29633] [PATCH] services: nginx: Allow to add raw content to the server blocks.
Date: Sat,  9 Dec 2017 23:55:04 +0100	[thread overview]
Message-ID: <20171209225504.9547-1-clement@lassieur.org> (raw)

* doc/guix.texi (Web Services): Document 'raw-content'.
* gnu/services/web.scm (<nginx-server-configuration>)[raw-content]: New field.
(emit-nginx-server-config): Add it.
---
 doc/guix.texi        | 3 +++
 gnu/services/web.scm | 9 +++++++--
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index ab1e5d057..09017ec65 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -14974,6 +14974,9 @@ you don't have a key or you don't want to use HTTPS.
 @item @code{server-tokens?} (default: @code{#f})
 Whether the server should add its configuration to response.
 
+@item @code{raw-content} (default: @code{'()})
+A list of raw lines added to the server block.
+
 @end table
 @end deftp
 
diff --git a/gnu/services/web.scm b/gnu/services/web.scm
index 7373d5671..78a6ad309 100644
--- a/gnu/services/web.scm
+++ b/gnu/services/web.scm
@@ -52,6 +52,7 @@
             nginx-server-configuration-ssl-certificate
             nginx-server-configuration-ssl-certificate-key
             nginx-server-configuration-server-tokens?
+            nginx-server-configuration-raw-content
 
             <nginx-upstream-configuration>
             nginx-upstream-configuration
@@ -104,7 +105,9 @@
   (ssl-certificate-key nginx-server-configuration-ssl-certificate-key
                        (default "/etc/nginx/key.pem"))
   (server-tokens?      nginx-server-configuration-server-tokens?
-                       (default #f)))
+                       (default #f))
+  (raw-content         nginx-server-configuration-raw-content
+                       (default '())))
 
 (define-record-type* <nginx-upstream-configuration>
   nginx-upstream-configuration make-nginx-upstream-configuration
@@ -180,7 +183,8 @@ of index files."
         (index (nginx-server-configuration-index server))
         (try-files (nginx-server-configuration-try-files server))
         (server-tokens? (nginx-server-configuration-server-tokens? server))
-        (locations (nginx-server-configuration-locations server)))
+        (locations (nginx-server-configuration-locations server))
+        (raw-content (nginx-server-configuration-raw-content server)))
     (define-syntax-parameter <> (syntax-rules ()))
     (define-syntax-rule (and/l x tail ...)
       (let ((x* x))
@@ -213,6 +217,7 @@ of index files."
      "\n"
      (map emit-nginx-location-config locations)
      "\n"
+     (map (lambda (x) (list "      " x "\n")) raw-content)
      "    }\n")))
 
 (define (emit-nginx-upstream-config upstream)
-- 
2.15.1

             reply	other threads:[~2017-12-09 22:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-09 22:55 Clément Lassieur [this message]
2017-12-16 22:00 ` [bug#29633] [PATCH] services: nginx: Allow to add raw content to the server blocks Christopher Baines
2017-12-18 11:07   ` bug#29633: " Clément Lassieur

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

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171209225504.9547-1-clement@lassieur.org \
    --to=clement@lassieur.org \
    --cc=29633@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 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).