diff options
author | Christopher Baines <mail@cbaines.net> | 2018-02-16 18:19:42 +0000 |
---|---|---|
committer | Christopher Baines <mail@cbaines.net> | 2018-06-12 21:18:10 +0100 |
commit | 25e071ead9ddf701485750eec41fd869e310eab0 (patch) | |
tree | 369b7432df89f8dc59995ae1d8f3d72dbf5be504 /gnu/services/web.scm | |
parent | bea07c7f550e0031950a333044699a1126f765fa (diff) | |
download | guix-25e071ead9ddf701485750eec41fd869e310eab0.tar.gz |
services: nginx: Support extra content in the http block.
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/web.scm')
-rw-r--r-- | gnu/services/web.scm | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/gnu/services/web.scm b/gnu/services/web.scm index aae2f3db0d..9a58eff5ef 100644 --- a/gnu/services/web.scm +++ b/gnu/services/web.scm @@ -77,6 +77,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> @@ -431,6 +432,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))) @@ -521,7 +524,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" @@ -550,7 +554,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 |