mirror of
https://github.com/MagicBOTAlex/nixos-server.git
synced 2025-12-13 01:35:28 +01:00
pocket accept cors
This commit is contained in:
parent
e70aee4ab6
commit
134fe2e279
10 changed files with 320 additions and 219 deletions
38
modules/buildCache.nix
Normal file
38
modules/buildCache.nix
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
{ pkgs, ... }: {
|
||||
services.harmonia = {
|
||||
enable = true;
|
||||
signKeyPaths = [ "/var/lib/secrets/harmonia.secret" ];
|
||||
settings = {
|
||||
bind = "0.0.0.0:5444";
|
||||
workers = 4;
|
||||
};
|
||||
};
|
||||
|
||||
imports = [ ./../networking/networkSetup.nix ];
|
||||
|
||||
services.caddy = {
|
||||
enable = true;
|
||||
virtualHosts."cache.deprived.dev" = {
|
||||
extraConfig = ''
|
||||
reverse_proxy localhost:5444
|
||||
|
||||
header {
|
||||
# Cache control for nix store paths
|
||||
Cache-Control "public, max-age=31536000, immutable"
|
||||
|
||||
# CORS headers if needed
|
||||
Access-Control-Allow-Origin "*"
|
||||
Access-Control-Allow-Methods "GET, HEAD, OPTIONS"
|
||||
}
|
||||
|
||||
# Optional: Enable compression
|
||||
encode gzip
|
||||
|
||||
# Optional: Logging
|
||||
log {
|
||||
output file /var/log/caddy/cache.log
|
||||
}
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue