strato-infra/machines/nginx/default.nix

38 lines
993 B
Nix
Raw Normal View History

2022-05-19 17:47:41 +02:00
{ config, pkgs, ... }: {
imports = [ ../../common ../../common/lxc.nix ];
networking.hostName = "nginx";
system.stateVersion = "21.11";
networking.firewall.enable = true;
networking.firewall.allowedTCPPorts = [ 80 443 ];
services.nginx = {
enable = true;
recommendedGzipSettings = true;
recommendedOptimisation = true;
recommendedProxySettings = true;
recommendedTlsSettings = true;
package = pkgs.nginxMainline;
virtualHosts."asraphiel.dev" = {
forceSSL = true;
http2 = true;
enableACME = true;
root = "/etc/main";
};
2022-05-19 21:10:04 +02:00
virtualHosts."git.asraphiel.dev" = {
forceSSL = true;
enableACME = true;
http2 = true;
locations."/" = {
2022-05-20 17:21:36 +02:00
proxyPass = "http://gitea.lxd:3000/";
2022-05-19 21:10:04 +02:00
proxyWebsockets = true;
};
};
2022-05-19 17:47:41 +02:00
};
security.acme.email = "acme@voidcorp.nl";
security.acme.acceptTerms = true;
environment.etc."main/index.html" = {
enable = true;
source = ./index.html;
};
}