my nixos dotfiles :3 (git.koi.rip mirror) git.koi.rip/koi/dotfiles
linux dotfiles neovim nixos catppuccin

seber: default virtual host

+24 -18
+24 -18
systems/seber/services/ebil-club.nix
··· 1 1 { lib, pkgs, ... }: 2 2 3 3 let 4 + tls = { 5 + onlySSL = true; 6 + sslCertificate = "/run/agenix/ssl-adamperkowski-cert"; 7 + sslCertificateKey = "/run/agenix/ssl-adamperkowski-key"; 8 + }; 9 + 4 10 mkSite = 5 11 { 6 12 name, ··· 13 19 14 20 home = "/var/ebil.club/${name}"; 15 21 rootDir = "${home}/${defaultHost}"; 16 - 17 - tls = { 18 - onlySSL = true; 19 - sslCertificate = "/run/agenix/ssl-adamperkowski-cert"; 20 - sslCertificateKey = "/run/agenix/ssl-adamperkowski-key"; 21 - }; 22 22 in 23 23 { 24 24 services.nginx.virtualHosts = { ··· 80 80 }) 81 81 ]; 82 82 83 - services.nginx.virtualHosts."ebil.club" = { 84 - locations = { 85 - "/" = { 86 - root = "/var/ebil.club/ebil.club"; 87 - index = "index.html"; 88 - extraConfig = "try_files $uri $uri/ =404;"; 83 + services.nginx.virtualHosts = { 84 + "_" = { 85 + locations."/".return = "307 https://ebil.club"; 86 + default = true; 87 + } 88 + // tls; 89 + 90 + "ebil.club" = { 91 + locations = { 92 + "/" = { 93 + root = "/var/ebil.club/ebil.club"; 94 + index = "index.html"; 95 + extraConfig = "try_files $uri $uri/ =404;"; 96 + }; 97 + "/discord".return = "302 https://discord.gg/mJAQHPJ9Eb"; 89 98 }; 90 - "/discord".return = "302 https://discord.gg/mJAQHPJ9Eb"; 91 - }; 92 - extraConfig = "error_page 404 /404.html;"; 93 - onlySSL = true; 94 - sslCertificate = "/run/agenix/ssl-adamperkowski-cert"; 95 - sslCertificateKey = "/run/agenix/ssl-adamperkowski-key"; 99 + extraConfig = "error_page 404 /404.html;"; 100 + } 101 + // tls; 96 102 }; 97 103 98 104 systemd.tmpfiles.rules = [