feat: caddy test

This commit is contained in:
Nick 2024-12-19 22:37:17 -06:00
parent 8b359bfb9f
commit 639a0a24e5
3 changed files with 9 additions and 22 deletions

View file

@ -1,9 +1,4 @@
{
flake,
config,
...
}: let
inherit (flake.config.machines.devices) server;
{flake, ...}: let
inherit (flake.config.services.instances) upRootNutrition web;
service = upRootNutrition;
localhost = web.localhost.address0;
@ -14,23 +9,12 @@ in {
virtualHosts = {
"${host}" = {
extraConfig = ''
redir /.well-known/carddav /remote.php/dav/ 301
redir /.well-known/caldav /remote.php/dav/ 301
root * /var/lib/website
reverse_proxy ${localhost}:${toString service.ports.port0}
file_server
try_files {path} /index.html
encode gzip
header {
# Disable FLoC tracking
Permissions-Policy interest-cohort=()
# Enable HSTS
Strict-Transport-Security "max-age=31536000; includeSubDomains"
# Prevent MIME-type sniffing
X-Content-Type-Options nosniff
tls ${service.ssl.cert} ${service.ssl.key}
tls ${service.ssl.cert} ${service.ssl.key}
'';
};
};