summary refs log tree commit diff
path: root/doc/guix.texi
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2017-01-18 08:08:07 +0000
committerLudovic Courtès <ludo@gnu.org>2017-01-19 14:44:59 +0100
commit9c557a69aebe49bba12009a01cfaabf88ec3f665 (patch)
treef03c3ab465fde7d50182f6cfb5c2e15afb6bdaa0 /doc/guix.texi
parentcb341293fa22cdbc4ffb869b9b2a94a0d8c8798b (diff)
downloadguix-9c557a69aebe49bba12009a01cfaabf88ec3f665.tar.gz
services: nginx: Add support for 'location' blocks.
* gnu/services/web.scm (<nginx-server-configuration>): Add field 'locations'.
(<nginx-location-configuration>): New record type.
(<nginx-named-location-configuration>): New record type.
(nginx-location-config): New function.
(default-nginx-server-config): Include locations.
* doc/guix.texi (Web Services): Document the new nginx-location-configuration
and nginx-named-location-configuration data types, as well as the changes to
the nginx-server-configuration.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Diffstat (limited to 'doc/guix.texi')
-rw-r--r--doc/guix.texi43
1 files changed, 43 insertions, 0 deletions
diff --git a/doc/guix.texi b/doc/guix.texi
index 256e6f55cf..7cd9cd046a 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -12380,6 +12380,11 @@ default server for connections matching no other server.
 @item @code{root} (default: @code{"/srv/http"})
 Root of the website nginx will serve.
 
+@item @code{locations} (default: @code{'()})
+A list of @dfn{nginx-location-configuration} or
+@dfn{nginx-named-location-configuration} records to use within this
+server block.
+
 @item @code{index} (default: @code{(list "index.html")})
 Index files to look for when clients ask for a directory.  If it cannot be found,
 Nginx will send the list of files in the directory.
@@ -12775,6 +12780,44 @@ explicitly.
 @end table
 @end deftp
 
+@deftp {Data Type} nginx-location-configuration
+Data type representing the configuration of an nginx @code{location}
+block.  This type has the following parameters:
+
+@table @asis
+@item @code{uri}
+URI which this location block matches.
+
+@anchor{nginx-location-configuration body}
+@item @code{body}
+Body of the location block, specified as a string. This can contain many
+configuration directives.  For example, to pass requests to a upstream
+server group defined using an @code{nginx-upstream-configuration} block,
+the following directive would be specified in the body @samp{proxy_pass
+http://upstream-name;}.
+
+@end table
+@end deftp
+
+@deftp {Data Type} nginx-named-location-configuration
+Data type representing the configuration of an nginx named location
+block.  Named location blocks are used for request redirection, and not
+used for regular request processing.  This type has the following
+parameters:
+
+@table @asis
+@item @code{name}
+Name to identify this location block.
+
+@item @code{body}
+@xref{nginx-location-configuration body}, as the body for named location
+blocks can be used in a similar way to the
+@code{nginx-location-configuration body}.  One restriction is that the
+body of a named location block cannot contain location blocks.
+
+@end table
+@end deftp
+
 @node Network File System
 @subsubsection Network File System
 @cindex NFS