Move Caddyfile to caddy.virtualHosts

This commit is contained in:
xqtc161 2024-06-19 11:09:38 +02:00
parent 6104163689
commit 7a8cb9b006
2 changed files with 91 additions and 41 deletions

View file

@ -26,45 +26,95 @@ with lib; {
services.caddy = {
enable = true;
email = "xqtc@tutanota.com";
configFile = pkgs.writeText "Caddyfile" ''
heroin.trade {
# configFile = pkgs.writeText "Caddyfile" ''
# heroin.trade {
# root * /var/www/website/public/
# handle_errors {
# rewrite * /404.html
# file_server
# }
# file_server
# }
# syncthing.heroin.trade {
# reverse_proxy http://localhost:8384 {
# header_up Host {upstream_hostport}
# }
# }
# demos.heroin.trade {
# root * /var/www/demos/
# file_server browse
# }
# git.heroin.trade {
# reverse_proxy http://localhost:3002
# }
#
# jellyfin.heroin.trade {
# reverse_proxy http://127.0.0.1:8096
# }
#
# calibre.heroin.trade {
# reverse_proxy http://localhost:3000
# }
#
# grafana.heroin.trade {
# reverse_proxy http://127.0.0.1:2342
# }
#
# uptime.heroin.trade {
# reverse_proxy 127.0.0.1:3001
# }
# '';
virtualHosts = {
"heroin.trade" = {
extraConfig = ''
root * /var/www/website/public/
handle_errors {
rewrite * /404.html
file_server
}
file_server
}
syncthing.heroin.trade {
'';
};
"syncthing.heroin.trade" = {
extraConfig = ''
reverse_proxy http://localhost:8384 {
header_up Host {upstream_hostport}
}
}
demos.heroin.trade {
'';
};
"demos.heroin.trade" = {
extraConfig = ''
root * /var/www/demos/
file_server browse
}
git.heroin.trade {
reverse_proxy http://localhost:3002
}
jellyfin.heroin.trade {
reverse_proxy http://127.0.0.1:8096
}
calibre.heroin.trade {
reverse_proxy http://localhost:3000
}
grafana.heroin.trade {
reverse_proxy http://127.0.0.1:2342
}
uptime.heroin.trade {
reverse_proxy 127.0.0.1:3001
}
'';
};
"git.heroin.trade" = {
extraConfig = ''
reverse_proxy http://localhost:3002
'';
};
"jellyfin.heroin.trade" = {
extraConfig = ''
reverse_proxy http://127.0.0.1:8096
'';
};
"calibre.heroin.trade" = {
extraConfig = ''
reverse_proxy http://localhost:3000
'';
};
"grafana.heroin.trade" = {
extraConfig = ''
reverse_proxy http://127.0.0.1:2342
'';
};
"uptime.heroin.trade" = {
extraConfig = ''
reverse_proxy http://127.0.0.1:3001
'';
};
};
};
services.syncthing.settings.gui.insecureSkipHostcheck = true;