diff options
author | Efraim Flashner <efraim@flashner.co.il> | 2017-10-01 19:59:55 +0300 |
---|---|---|
committer | Efraim Flashner <efraim@flashner.co.il> | 2017-10-01 22:16:22 +0300 |
commit | 64df08f0cfac8f7a329002afa3461fd62a4b229c (patch) | |
tree | 019909423138ceb49cdd86f1af48d366503db68f /gnu/services/web.scm | |
parent | b83ad3ace56c65a367e8f58c7b78323cf251b94b (diff) | |
parent | 0ef1c223071869488c35b72b7407234c11425589 (diff) | |
download | guix-64df08f0cfac8f7a329002afa3461fd62a4b229c.tar guix-64df08f0cfac8f7a329002afa3461fd62a4b229c.tar.gz |
Merge remote-tracking branch 'origin/master' into core-updates
Diffstat (limited to 'gnu/services/web.scm')
-rw-r--r-- | gnu/services/web.scm | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/gnu/services/web.scm b/gnu/services/web.scm index 18278502e4..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) @@ -262,7 +268,7 @@ of index files." (define nginx-activation (match-lambda (($ <nginx-configuration> nginx log-directory run-directory server-blocks - upstream-blocks config-file) + upstream-blocks file) #~(begin (use-modules (guix build utils)) @@ -281,7 +287,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 +295,14 @@ of index files." (define nginx-shepherd-service (match-lambda (($ <nginx-configuration> 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)))))) |