feat: slight reworks and added the 2006 site

This commit is contained in:
silver 2025-04-03 22:32:32 +01:00
parent 6e496b4867
commit 07b6e478cc
Signed by: silver
GPG key ID: 36F93D61BAD3FD7D
5 changed files with 144 additions and 48 deletions

View file

@ -9,10 +9,6 @@ with lib; {
imports = [];
config = {
services.skynet.acme.domains = [
"${year}.skynet.ie"
];
services.skynet.dns.records = [
{
record = year;
@ -27,6 +23,28 @@ with lib; {
forceSSL = true;
useACMEHost = "skynet";
root = "${inputs."skynet_website_${year}".defaultPackage."x86_64-linux"}";
# Handle any of the old php sites
# https://stackoverflow.com/a/21911610
locations = {
"/" = {
index = "index.html index.htm index.php";
tryFiles = "$uri $uri.html $uri/ @extensionless-php";
};
"~ \\.php$" = {
extraConfig = ''
fastcgi_pass unix:${config.services.phpfpm.pools.old_sites.socket};
fastcgi_index index.php;
'';
tryFiles = "$uri =404";
};
"@extensionless-php" = {
extraConfig = ''
rewrite ^(.*)$ $1.php last;
'';
};
};
};
};
};