forked from Zynh0722/permafrost
add nginx
This commit is contained in:
parent
3cf5fa031a
commit
7f6594fce5
2 changed files with 22 additions and 1 deletions
17
modules/nginx.nix
Normal file
17
modules/nginx.nix
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
{ lib, config, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
cfg = config.permafrost.nginx;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.permafrost.nginx = {
|
||||||
|
enable = lib.mkEnableOption "nginx nixos module";
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
services.nginx.enable = true;
|
||||||
|
security.acme.acceptTerms = true;
|
||||||
|
|
||||||
|
networking.firewall.allowedTCPPorts = [ 80 443 ];
|
||||||
|
};
|
||||||
|
}
|
|
@ -21,6 +21,10 @@ in
|
||||||
wants = [ "network.target" ];
|
wants = [ "network.target" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
networking.firewall.allowedTCPPorts = [ 3000 ];
|
permafrost.nginx.enable = lib.mkDefault true;
|
||||||
|
services.nginx.virtualHosts."nyazoom.zynh.me" = {
|
||||||
|
serverName = "nyazoom.zynh.me";
|
||||||
|
locations."/".proxyPass = "http://localhost:3000";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue