summary refs log tree commit diff
path: root/gnu
diff options
context:
space:
mode:
authorOleg Pykhalov <go.wigust@gmail.com>2017-09-23 03:27:49 +0300
committerJulien Lepiller <julien@lepiller.eu>2017-09-28 20:37:40 +0200
commit4d14808af4c01b4fb0a4564584aa68f0e53c4ef4 (patch)
tree5c361a387338425dd6ca3c2b1a4ddfd5d4e0c441 /gnu
parent80c3f4d6c04f7112afab5ce309c8b73d9789c79a (diff)
downloadguix-4d14808af4c01b4fb0a4564584aa68f0e53c4ef4.tar.gz
services: web: Add try-files for the nginx-service-type.
* gnu/services/web.scm (<nginx-server-configuration>): Add
  nginx-server-configuration-try-files.
(emit-nginx-server-config): Use it.
* doc/guix.texi (Web Services): Document it.
Diffstat (limited to 'gnu')
-rw-r--r--gnu/services/web.scm6
1 files changed, 6 insertions, 0 deletions
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)