@@ -18,6 +18,7 @@ let
1818
1919 ${cfg.config}
2020
21+ ${optionalString (cfg.httpConfig == "") ''
2122 http {
2223 include ${cfg.package}/conf/mime.types;
2324 include ${cfg.package}/conf/fastcgi.conf;
@@ -89,8 +90,15 @@ let
8990 }
9091 ''}
9192
93+ ${cfg.appendHttpConfig}
94+ }''}
95+
96+ ${optionalString (cfg.httpConfig != "") ''
97+ http {
98+ include ${cfg.package}/conf/mime.types;
99+ include ${cfg.package}/conf/fastcgi.conf;
92100 ${cfg.httpConfig}
93− }
101+ }''}
94102
95103 ${cfg.appendConfig}
96104 '';
@@ -245,7 +253,22 @@ in
245253 httpConfig = mkOption {
246254 type = types.lines;
247255 default = "";
248− description = "Configuration lines to be appended inside of the http {} block.";
256+ description = "
257+ Configuration lines to be set inside the http block.
258+ This is mutually exclusive with the structured configuration
259+ via virtualHosts and the recommendedXyzSettings configuration
260+ options. See appendHttpConfig for appending to the generated http block.
261+ ";
262+ };
263+
264+ appendHttpConfig = mkOption {
265+ type = types.lines;
266+ default = "";
267+ description = "
268+ Configuration lines to be appended to the generated http block.
269+ This is mutually exclusive with using httpConfig for specifying the whole
270+ http block verbatim.
271+ ";
249272 };
250273
251274 stateDir = mkOption {
@@ -353,7 +376,6 @@ in
353376 ) virtualHosts
354377 );
355378
356−
357379 users.extraUsers = optionalAttrs (cfg.user == "nginx") (singleton
358380 { name = "nginx";
359381 group = cfg.group;