mirror of
https://gitlab.com/upRootNutrition/dotfiles.git
synced 2025-08-10 05:44:38 -05:00
feat: caddy test
This commit is contained in:
parent
38b1a6a95e
commit
12e63f8108
1 changed files with 9 additions and 17 deletions
|
@ -1,9 +1,7 @@
|
||||||
{flake, ...}: let
|
{flake, ...}: let
|
||||||
inherit (flake.config.machines.devices) server;
|
|
||||||
inherit (flake.config.people.users) user0;
|
|
||||||
inherit (flake.config.services.instances) upRootNutrition web;
|
inherit (flake.config.services.instances) upRootNutrition web;
|
||||||
service = upRootNutrition;
|
service = upRootNutrition;
|
||||||
localhost = web.localhost.address0;
|
# localhost = web.localhost.address0;
|
||||||
host = web.domains.url3;
|
host = web.domains.url3;
|
||||||
in {
|
in {
|
||||||
services = {
|
services = {
|
||||||
|
@ -11,23 +9,14 @@ in {
|
||||||
virtualHosts = {
|
virtualHosts = {
|
||||||
"${host}" = {
|
"${host}" = {
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
root * /var/lib/website/dist
|
# Root directory where your compiled Elm files are located
|
||||||
try_files {path} /index.html
|
root * ${service.path.path0}
|
||||||
|
|
||||||
file_server
|
file_server
|
||||||
|
|
||||||
# Optional: Add security headers
|
encode gzip
|
||||||
header {
|
|
||||||
Strict-Transport-Security "max-age=31536000;"
|
|
||||||
X-Content-Type-Options "nosniff"
|
|
||||||
X-Frame-Options "DENY"
|
|
||||||
Referrer-Policy "strict-origin-when-cross-origin"
|
|
||||||
}
|
|
||||||
|
|
||||||
# Your existing redirects
|
try_files {path} /index.html
|
||||||
redir /.well-known/carddav /remote.php/dav/ 301
|
|
||||||
redir /.well-known/caldav /remote.php/dav/ 301
|
|
||||||
|
|
||||||
reverse_proxy ${localhost}:${toString service.ports.port0}
|
|
||||||
|
|
||||||
tls ${service.ssl.cert} ${service.ssl.key}
|
tls ${service.ssl.cert} ${service.ssl.key}
|
||||||
'';
|
'';
|
||||||
|
@ -35,4 +24,7 @@ in {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
systemd.tmpfiles.rules = [
|
||||||
|
"Z ${service.paths.path0} 755 caddy caddy -"
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue