feat: new nginx configuration

This commit is contained in:
Zhongheng Liu 2024-08-09 16:15:27 +08:00
commit 3651ddb6cb

View file

@ -1,6 +1,21 @@
{...}:
{
services.nginx = {
enable = true;
};
{pkgs, ...}: {
services.nginx = {
enable = true;
virtualHosts."localhost" = {
root = "/srv/public";
locations = {
"/" = {
root = "/srv/public";
extraConfig = ''
autoindex on;
'';
};
};
listenAddresses = [
"127.0.0.1"
"[::1]"
];
};
};
networking.firewall.allowedTCPPorts = [80];
}