nixos-server-config/nix-containers.nix

31 lines
666 B
Nix
Raw Normal View History

2019-11-10 08:41:19 +00:00
{ config, pkgs, ... }:
{
containers = {
nginx = {
autoStart = false;
config = { config, pkgs, ...}: {
2019-11-10 08:41:19 +00:00
networking = {
firewall.allowedTCPPorts = [ 80 ];
};
services.nginx = {
enable = true;
virtualHosts = {
www ={
listen = [
{ addr = "0.0.0.0"; port = 80; }
2019-11-10 08:41:19 +00:00
{ addr = "[::]"; port = 80; }
];
serverName = "nixos-server";
locations = {
"/" = {
root = "/var/www";
};
};
};
};
};
};
};
2019-11-10 08:41:19 +00:00
};
}