nixos-config/modules/nginx.nix

43 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-07-28 14:39:11 +04:00
default = true;
2020-03-10 02:12:44 +04:00
locations."/" = {
root = "/var/lib/balsoft.ru";
index = "index.txt";
};
2020-07-28 14:02:32 +04:00
locations."/.well-known".proxyPass = "https://localhost:13748";
locations."/_matrix" = {
proxyPass = "https://localhost:13748";
};
2020-02-17 17:00:59 +04:00
enableACME = true;
addSSL = true;
};
"code.balsoft.ru" = {
locations."/" = { proxyPass = "http://localhost:6000"; };
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;
"share.balsoft.ru" = {
locations."/" = { root = "/var/lib/share"; };
} // default;
};
};
security.acme = {
email = "balsoft@balsoft.ru";
acceptTerms = true;
};
2020-02-17 17:00:59 +04:00
}