nixos/nginx: add prependConfig options
This is needed for example to load dynamic nginx modules. Which need to be loaded before any `http` or `stream` blocks. See: https://docs.nginx.com/nginx/admin-guide/dynamic-modules/dynamic-modules/#installing-and-loading-the-module
This commit is contained in:
parent
8fba93d37d
commit
b8d052a70d
@ -163,6 +163,8 @@ let
|
|||||||
configFile =
|
configFile =
|
||||||
(if cfg.validateConfigFile then pkgs.writers.writeNginxConfig else pkgs.writeText) "nginx.conf"
|
(if cfg.validateConfigFile then pkgs.writers.writeNginxConfig else pkgs.writeText) "nginx.conf"
|
||||||
''
|
''
|
||||||
|
${cfg.prependConfig}
|
||||||
|
|
||||||
pid /run/nginx/nginx.pid;
|
pid /run/nginx/nginx.pid;
|
||||||
error_log ${cfg.logError};
|
error_log ${cfg.logError};
|
||||||
daemon off;
|
daemon off;
|
||||||
@ -835,6 +837,18 @@ in
|
|||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
prependConfig = mkOption {
|
||||||
|
type = types.lines;
|
||||||
|
default = "";
|
||||||
|
description = ''
|
||||||
|
Configuration lines prepended to the generated Nginx
|
||||||
|
configuration file. Can for example be used to load modules.
|
||||||
|
{option}`prependConfig` can be specified more than once
|
||||||
|
and its value will be concatenated (contrary to {option}`config`
|
||||||
|
which can be set only once).
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
appendConfig = mkOption {
|
appendConfig = mkOption {
|
||||||
type = types.lines;
|
type = types.lines;
|
||||||
default = "";
|
default = "";
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user