nginx module: add index and tryFiles

+21 -2
+2
nixos/modules/services/web-servers/nginx/default.nix
··· 165 165 mkLocations = locations: concatStringsSep "\n" (mapAttrsToList (location: config: '' 166 166 location ${location} { 167 167 ${optionalString (config.proxyPass != null) "proxy_pass ${config.proxyPass};"} 168 + ${optionalString (config.index != null) "index ${config.index};"} 169 + ${optionalString (config.tryFiles != null) "try_files ${config.tryFiles};"} 168 170 ${optionalString (config.root != null) "root ${config.root};"} 169 171 ${config.extraConfig} 170 172 }
+19 -2
nixos/modules/services/web-servers/nginx/location-options.nix
··· 14 14 default = null; 15 15 example = "http://www.example.org/"; 16 16 description = '' 17 - Adds proxy_pass directive and sets default proxy headers Host, X-Real-Ip 18 - and X-Forwarded-For. 17 + Adds proxy_pass directive. 18 + ''; 19 + }; 20 + 21 + index = mkOption { 22 + type = types.nullOr types.str; 23 + default = null; 24 + example = "index.php index.html"; 25 + description = '' 26 + Adds index directive. 27 + ''; 28 + }; 29 + 30 + tryFiles = mkOption { 31 + type = types.nullOr types.str; 32 + default = null; 33 + example = "$uri =404"; 34 + description = '' 35 + Adds try_files directive. 19 36 ''; 20 37 }; 21 38