nixos-config/modules/nginx.nix

41 lines
1.1 KiB
Nix
Raw Normal View History

2020-02-17 17:00:59 +04:00
{ pkgs, config, lib, ... }: {
services.nginx = {
enable = true;
appendHttpConfig = "charset utf-8;";
virtualHosts = let
default = {
forceSSL = true;
enableACME = true;
};
in {
"balsoft.ru" = {
2020-03-10 02:12:44 +04:00
locations."/" = {
root = "/var/lib/balsoft.ru";
index = "index.txt";
};
2020-02-17 17:00:59 +04:00
enableACME = true;
addSSL = true;
};
2020-03-10 01:37:59 +04:00
"corona.balsoft.ru" = {
2020-03-10 02:12:44 +04:00
locations."/" = {
root = "/var/lib/corona";
index = "index.html";
extraConfig = "add_header 'Access-Control-Allow-Origin' '*'";
};
2020-03-10 01:37:59 +04:00
} // default;
2020-02-17 17:00:59 +04:00
"cache.balsoft.ru" = {
locations."/" = { proxyPass = "http://localhost:5000"; };
} // default;
"matrix.balsoft.ru" = {
locations."/" = { proxyPass = "https://localhost:13748"; };
} // default;
"mai.balsoft.ru" = {
locations."/" = { root = "/var/lib/important"; };
} // default;
"share.balsoft.ru" = {
locations."/" = { root = "/var/lib/share"; };
} // default;
};
};
}