1 # This file defines the options that can be used both for the Nginx
2 # main server configuration, and for the virtual hosts. (The latter
3 # has additional options that affect the web server as a whole, like
4 # the user/group to run under.)
12 basicAuth = mkOption {
13 type = types.attrsOf types.str;
15 example = literalExpression ''
21 Basic Auth protection for a vhost.
23 WARNING: This is implemented to store the password in plain text in the
28 basicAuthFile = mkOption {
29 type = types.nullOr types.path;
32 Basic Auth password file for a vhost.
33 Can be created via: {command}`htpasswd -c <filename> <username>`.
35 WARNING: The generate file contains the users' passwords in a
36 non-cryptographically-securely hashed way.
40 proxyPass = mkOption {
41 type = types.nullOr types.str;
43 example = "http://www.example.org/";
45 Adds proxy_pass directive and sets recommended proxy headers if
46 recommendedProxySettings is enabled.
50 proxyWebsockets = mkOption {
55 Whether to support proxying websocket connections with HTTP/1.1.
60 type = types.nullOr types.str;
62 example = "index.php index.html";
69 type = types.nullOr types.str;
71 example = "$uri =404";
73 Adds try_files directive.
78 type = types.nullOr types.path;
80 example = "/your/root/directory";
82 Root directory for requests.
87 type = types.nullOr types.path;
89 example = "/your/alias/directory";
91 Alias directory for requests.
96 type = with types; nullOr (oneOf [ str int ]);
98 example = "301 http://example.com$request_uri";
100 Adds a return directive, for e.g. redirections.
104 fastcgiParams = mkOption {
105 type = types.attrsOf (types.either types.str types.path);
108 FastCGI parameters to override. Unlike in the Nginx
109 configuration file, overriding only some default parameters
110 won't unset the default values for other parameters.
114 extraConfig = mkOption {
118 These lines go to the end of the location verbatim.
122 priority = mkOption {
126 Order of this location block in relation to the others in the vhost.
127 The semantics are the same as with `lib.mkOrder`. Smaller values have
132 recommendedProxySettings = mkOption {
134 default = config.services.nginx.recommendedProxySettings;
135 defaultText = literalExpression "config.services.nginx.recommendedProxySettings";
137 Enable recommended proxy settings.