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 by running {command}`nix-shell --packages apacheHttpd --run 'htpasswd -B -c FILENAME USERNAME'`.
37 proxyPass = mkOption {
38 type = types.nullOr types.str;
40 example = "http://www.example.org/";
42 Adds proxy_pass directive and sets recommended proxy headers if
43 recommendedProxySettings is enabled.
47 proxyWebsockets = mkOption {
52 Whether to support proxying websocket connections with HTTP/1.1.
57 type = types.nullOr types.str;
59 example = "index.php index.html";
66 type = types.nullOr types.str;
68 example = "$uri =404";
70 Adds try_files directive.
75 type = types.nullOr types.path;
77 example = "/your/root/directory";
79 Root directory for requests.
84 type = types.nullOr types.path;
86 example = "/your/alias/directory";
88 Alias directory for requests.
93 type = with types; nullOr (oneOf [ str int ]);
95 example = "301 http://example.com$request_uri";
97 Adds a return directive, for e.g. redirections.
101 fastcgiParams = mkOption {
102 type = types.attrsOf (types.either types.str types.path);
105 FastCGI parameters to override. Unlike in the Nginx
106 configuration file, overriding only some default parameters
107 won't unset the default values for other parameters.
111 extraConfig = mkOption {
115 These lines go to the end of the location verbatim.
119 priority = mkOption {
123 Order of this location block in relation to the others in the vhost.
124 The semantics are the same as with `lib.mkOrder`. Smaller values have
129 recommendedProxySettings = mkOption {
131 default = config.services.nginx.recommendedProxySettings;
132 defaultText = literalExpression "config.services.nginx.recommendedProxySettings";
134 Enable recommended proxy settings.