This commit is contained in:
parent
ae9854f178
commit
ca66e8d7b2
13 changed files with 171 additions and 157 deletions
|
|
@ -1,48 +1,46 @@
|
|||
{ flakes, pkgs, ... }:
|
||||
let
|
||||
cache = pkg: ''
|
||||
location ~* \.(png|jpg|jpeg|gif|svg|ico|woff|woff2|ttf)$ {
|
||||
expires max;
|
||||
add_header Cache-Control "public, no-transform";
|
||||
root ${pkg};
|
||||
}
|
||||
'';
|
||||
regular = "${flakes.homepage.packages.${pkgs.system}.website}";
|
||||
gay = "${flakes.homepage.packages.${pkgs.system}.website-gay}";
|
||||
ssl = {
|
||||
forceSSL = true;
|
||||
http2 = true;
|
||||
enableACME = true;
|
||||
};
|
||||
base =
|
||||
pkg:
|
||||
{
|
||||
extraConfig = cache pkg;
|
||||
}
|
||||
// ssl;
|
||||
site =
|
||||
pkg:
|
||||
{
|
||||
locations."/".root = pkg;
|
||||
}
|
||||
// (base pkg);
|
||||
redirect =
|
||||
return:
|
||||
{
|
||||
locations."/".return = return;
|
||||
}
|
||||
// ssl;
|
||||
in
|
||||
{
|
||||
services.nginx = {
|
||||
virtualHosts."donsz.nl" = {
|
||||
forceSSL = true;
|
||||
http2 = true;
|
||||
enableACME = true;
|
||||
|
||||
locations."/" = {
|
||||
root = "${flakes.homepage.packages.${pkgs.system}.website}";
|
||||
};
|
||||
};
|
||||
virtualHosts."blog.donsz.nl" = {
|
||||
forceSSL = true;
|
||||
http2 = true;
|
||||
enableACME = true;
|
||||
|
||||
locations."/".return = "301 https://donsz.nl/blog";
|
||||
};
|
||||
virtualHosts."gay.donsz.nl" = {
|
||||
forceSSL = true;
|
||||
http2 = true;
|
||||
enableACME = true;
|
||||
|
||||
locations."/" = {
|
||||
root = "${flakes.homepage.packages.${pkgs.system}.website-gay}";
|
||||
};
|
||||
};
|
||||
virtualHosts."jana.is.fckn.gay" = {
|
||||
forceSSL = true;
|
||||
http2 = true;
|
||||
enableACME = true;
|
||||
|
||||
locations."/" = {
|
||||
root = "${flakes.homepage.packages.${pkgs.system}.website-gay}";
|
||||
};
|
||||
};
|
||||
virtualHosts."jdonszelmann.nl" = {
|
||||
forceSSL = true;
|
||||
http2 = true;
|
||||
enableACME = true;
|
||||
|
||||
locations."/" = {
|
||||
root = "${flakes.homepage.packages.${pkgs.system}.website}";
|
||||
};
|
||||
virtualHosts = {
|
||||
"donsz.nl" = site regular;
|
||||
"jdonszelmann.nl" = site regular;
|
||||
"blog.donsz.nl" = redirect "301 https://donsz.nl/blog";
|
||||
"gay.donsz.nl" = site gay;
|
||||
"jana.is.fckn.gay" = site gay;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue