added funni nginx url redirct

This commit is contained in:
Gerg-L 2023-09-15 19:31:53 -04:00
parent a9e363f1ca
commit 01c1429791
Signed by: gerg-l
SSH key fingerprint: SHA256:FPYDHIkvMocr4wdmZXpgpJjsb2Tw6rASs2ISPbOb0KI
2 changed files with 35 additions and 4 deletions

View file

@ -0,0 +1,29 @@
_: {config, ...}: {
sops.secrets = {
ssl_cert = {
owner = "nginx";
group = "nginx";
};
ssl_key = {
owner = "nginx";
group = "nginx";
};
};
services.nginx = {
enable = true;
recommendedGzipSettings = true;
recommendedOptimisation = true;
recommendedProxySettings = true;
recommendedTlsSettings = true;
virtualHosts."nix-fu.com" = {
forceSSL = true;
sslCertificate = config.sops.secrets.ssl_cert.path;
sslCertificateKey = config.sops.secrets.ssl_key.path;
serverAliases = ["www.nix-fu.com" "nix-fu.com"];
locations."/".return = "301 $scheme://www.github.com/Gerg-L$request_uri";
};
};
networking.firewall = {
allowedTCPPorts = [80 443];
};
}