nixos-config/profiles/servers/nginx.nix

50 lines
1.3 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";
};
locations."/.well-known" = {
proxyPass = "http://localhost:13748";
};
2020-07-28 14:02:32 +04:00
locations."/_matrix" = {
2020-07-30 00:50:51 +04:00
proxyPass = "http://localhost:13748";
2020-07-28 14:02:32 +04:00
};
2020-02-17 17:00:59 +04:00
enableACME = true;
2021-03-18 23:37:59 +04:00
forceSSL = true;
2020-02-17 17:00:59 +04:00
};
"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 = "http://localhost:13748";
};
2020-02-17 17:00:59 +04:00
} // default;
"share.balsoft.ru" = {
locations."/" = { root = "/var/lib/share"; };
} // default;
2021-03-18 14:03:09 +04:00
"things.balsoft.ru" = {
locations."/" = { root = "/nix/var/nix/profiles/per-user/nginx/random-things/www"; };
} // default;
2020-02-17 17:00:59 +04:00
};
};
security.acme = {
email = "balsoft@balsoft.ru";
acceptTerms = true;
};
2020-02-17 17:00:59 +04:00
}