nginx
This commit is contained in:
parent
c26cc20f57
commit
d53e340966
8 changed files with 93 additions and 36 deletions
44
mod/nginx.nix
Normal file
44
mod/nginx.nix
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
{
|
||||
lib,
|
||||
options,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
with lib;
|
||||
{
|
||||
options.services.nginx.virtualHostsPub = mkOption {
|
||||
type = options.services.nginx.virtualHosts.type;
|
||||
default = { };
|
||||
description = "Declarative vhost config listening to ::0 and 0.0.0.0";
|
||||
};
|
||||
|
||||
config = {
|
||||
services.nginx.virtualHosts = builtins.mapAttrs (
|
||||
_: v:
|
||||
v
|
||||
// {
|
||||
addSSL = true;
|
||||
listen = [
|
||||
{
|
||||
addr = "0.0.0.0";
|
||||
port = 443;
|
||||
ssl = true;
|
||||
}
|
||||
{
|
||||
addr = "0.0.0.0";
|
||||
port = 80;
|
||||
}
|
||||
{
|
||||
addr = "[::0]";
|
||||
port = 443;
|
||||
ssl = true;
|
||||
}
|
||||
{
|
||||
addr = "[::0]";
|
||||
port = 80;
|
||||
}
|
||||
];
|
||||
}
|
||||
) config.services.nginx.virtualHostsPub;
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue