aboutsummaryrefslogtreecommitdiff
path: root/gnu/services
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2018-02-16 18:19:42 +0000
committerChristopher Baines <mail@cbaines.net>2018-05-17 12:10:27 +0100
commit6760ddefdb9dedabba6252618a5acaea45e845ab (patch)
treea9844bfb5fa19c8fc07cd84a55b61d90ec249c73 /gnu/services
parent7376ba4cd4d07b5640ab49acad371a8ef3f090bc (diff)
downloadguix-nginx-support-extra-http-block-content.tar
guix-nginx-support-extra-http-block-content.tar.gz
services: nginx: Support extra content in the http block.nginx-support-extra-http-block-content
This helpful when adding content to the nginx configuration file, which isn't 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.
Diffstat (limited to 'gnu/services')
-rw-r--r--gnu/services/web.scm9
1 files changed, 7 insertions, 2 deletions
diff --git a/gnu/services/web.scm b/gnu/services/web.scm
index b336a8dd30..16ccbb239e 100644
--- a/gnu/services/web.scm
+++ b/gnu/services/web.scm
@@ -73,6 +73,7 @@
nginx-configuration-upstream-blocks
nginx-configuration-server-names-hash-bucket-size
nginx-configuration-server-names-hash-bucket-max-size
+ nginx-configuration-extra-content
nginx-configuration-file
<nginx-server-configuration>
@@ -423,6 +424,8 @@
(default #f))
(server-names-hash-bucket-max-size nginx-configuration-server-names-hash-bucket-max-size
(default #f))
+ (extra-content nginx-configuration-extra-content
+ (default '()))
(file nginx-configuration-file ;#f | string | file-like
(default #f)))
@@ -513,7 +516,8 @@ of index files."
(nginx log-directory run-directory
server-blocks upstream-blocks
server-names-hash-bucket-size
- server-names-hash-bucket-max-size)
+ server-names-hash-bucket-max-size
+ extra-content)
(apply mixed-text-file "nginx.conf"
(flatten
"user nginx nginx;\n"
@@ -542,7 +546,8 @@ of index files."
"\n"
(map emit-nginx-upstream-config upstream-blocks)
(map emit-nginx-server-config server-blocks)
- "}\n"
+ extra-content
+ "\n}\n"
"events {}\n"))))
(define %nginx-accounts