From 352a5b639b2adfa343f5a786529bb112636757ea Mon Sep 17 00:00:00 2001 From: Tobias Geerinckx-Rice Date: Tue, 5 Sep 2017 18:54:08 +0200 Subject: =?UTF-8?q?services:=20web:=20Fix=20nginx-service-type's=20?= =?UTF-8?q?=E2=80=98file=E2=80=99=20procedure.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/services/web.scm (nginx-activation, nginx-shepherd-service): Replace references to non-existent ‘config-file’ with ‘file’. * doc/guix.texi (Web Services): Likewise. --- gnu/services/web.scm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'gnu/services/web.scm') diff --git a/gnu/services/web.scm b/gnu/services/web.scm index 18278502e4..4aa6fd501c 100644 --- a/gnu/services/web.scm +++ b/gnu/services/web.scm @@ -262,7 +262,7 @@ of index files." (define nginx-activation (match-lambda (($ nginx log-directory run-directory server-blocks - upstream-blocks config-file) + upstream-blocks file) #~(begin (use-modules (guix build utils)) @@ -281,7 +281,7 @@ of index files." (mkdir-p (string-append #$run-directory "/logs")) ;; Check configuration file syntax. (system* (string-append #$nginx "/sbin/nginx") - "-c" #$(or config-file + "-c" #$(or file (default-nginx-config nginx log-directory run-directory server-blocks upstream-blocks)) "-t"))))) @@ -289,14 +289,14 @@ of index files." (define nginx-shepherd-service (match-lambda (($ nginx log-directory run-directory server-blocks - upstream-blocks config-file) + upstream-blocks file) (let* ((nginx-binary (file-append nginx "/sbin/nginx")) (nginx-action (lambda args #~(lambda _ (zero? (system* #$nginx-binary "-c" - #$(or config-file + #$(or file (default-nginx-config nginx log-directory run-directory server-blocks upstream-blocks)) #$@args)))))) -- cgit v1.2.3 From 4d14808af4c01b4fb0a4564584aa68f0e53c4ef4 Mon Sep 17 00:00:00 2001 From: Oleg Pykhalov Date: Sat, 23 Sep 2017 03:27:49 +0300 Subject: services: web: Add try-files for the nginx-service-type. * gnu/services/web.scm (): Add nginx-server-configuration-try-files. (emit-nginx-server-config): Use it. * doc/guix.texi (Web Services): Document it. --- gnu/services/web.scm | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'gnu/services/web.scm') diff --git a/gnu/services/web.scm b/gnu/services/web.scm index 4aa6fd501c..9d713003c3 100644 --- a/gnu/services/web.scm +++ b/gnu/services/web.scm @@ -99,6 +99,8 @@ (default '())) (index nginx-server-configuration-index (default (list "index.html"))) + (try-files nginx-server-configuration-try-files + (default '())) (ssl-certificate nginx-server-configuration-ssl-certificate (default "/etc/nginx/cert.pem")) (ssl-certificate-key nginx-server-configuration-ssl-certificate-key @@ -179,6 +181,7 @@ of index files." (nginx-server-configuration-ssl-certificate-key server)) (root (nginx-server-configuration-root server)) (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))) (define-syntax-parameter <> (syntax-rules ())) @@ -207,6 +210,9 @@ of index files." (and/l ssl-certificate-key " ssl_certificate_key " <> ";\n") " root " root ";\n" " index " (config-index-strings index) ";\n" + (if (not (nil? try-files)) + (and/l (config-index-strings try-files) " try_files " <> ";\n") + "") " server_tokens " (if server-tokens? "on" "off") ";\n" "\n" (map emit-nginx-location-config locations) -- cgit v1.2.3