nixos-configs/hosts/nginx/configuration.nix
Julius c2a369c498
Add grafana and postgresql
I should probably move some stuff over from my other postgres instance
2021-11-14 22:46:14 +01:00

63 lines
2.1 KiB
Nix
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{ config, pkgs, ... }:
let
proxy = url: {
forceSSL = true;
enableACME = true;
locations."/" = {
proxyPass = url;
proxyWebsockets = true;
};
};
k8s_proxy = proxy "http://10.42.20.5:80/";
in {
imports = [
# Import common config
../../common/generic-lxc.nix
../../common
];
networking.hostName = "nginx";
# This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions
# on your system were taken. Its perfectly fine and recommended to leave
# this value at the release version of the first install of this system.
# Before changing this value read the documentation for this option
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "21.11"; # Did you read the comment?
environment.systemPackages = with pkgs; [ ];
networking.firewall.enable = true;
networking.firewall.allowedTCPPorts = [ 80 443 ];
services.nginx = {
enable = true;
recommendedGzipSettings = true;
recommendedOptimisation = true;
recommendedProxySettings = true;
recommendedTlsSettings = true;
virtualHosts."voidcorp.nl" = k8s_proxy;
virtualHosts."harbor.voidcorp.nl" = k8s_proxy;
virtualHosts."cdn.voidcorp.nl" = proxy "http://10.42.2.6:80/";
virtualHosts."git.voidcorp.nl" = proxy "http://gitea.voidlocal:3000/";
virtualHosts."galerievanslagmaat.nl" = k8s_proxy;
virtualHosts."staging.galerievanslagmaat.nl" = k8s_proxy;
virtualHosts."groenehartansichtkaarten.nl" = k8s_proxy;
virtualHosts."drone.voidcorp.nl" = k8s_proxy;
virtualHosts."vaultwarden.voidcorp.nl" = proxy "http://10.42.20.4:8000/";
virtualHosts."s3.voidcorp.nl" = proxy "http://10.42.20.6:9000/";
virtualHosts."explore.s3.voidcorp.nl" = proxy "http://10.42.20.6:9001/";
virtualHosts."registry.voidcorp.nl" = proxy "http://10.42.20.7:5000/";
virtualHosts."grafana.voidcorp.nl" = proxy "http://10.42.20.9:3000/";
};
security.acme.email = "acme@voidcorp.nl";
security.acme.acceptTerms = true;
}