1
Fork 0
mirror of https://github.com/RGBCube/ncc synced 2025-07-28 18:47:44 +00:00

fix: make cache serve s3 actually

This commit is contained in:
RGBCube 2025-02-26 02:41:58 +03:00
parent 31bf6bc062
commit 6c42f34c45
Signed by: RGBCube
SSH key fingerprint: SHA256:CzqbPcfwt+GxFYNnFVCqoN5Itn4YFrshg1TrnACpA5M
2 changed files with 13 additions and 6 deletions

View file

@ -9,10 +9,10 @@ in {
services.nginx.virtualHosts.${fqdn} = merge config.services.nginx.sslTemplate {
locations."/" = {
extraConfig = /* nginx */ ''
proxy_set_header Host "hercules.${config.services.garage.settings.s3_api.root_domain}";
proxy_set_header Host "hercules.${config.services.garage.settings.s3_web.root_domain}";
'';
proxyPass = "http://${config.services.garage.settings.s3_api.api_bind_addr}";
proxyPass = "http://${config.services.garage.settings.s3_web.bind_addr}";
};
};
}

View file

@ -2,9 +2,11 @@
inherit (config.networking) domain;
inherit (lib) enabled merge;
fqdn = "s3.${domain}";
fqdnS3 = "s3.${domain}";
fqdnWeb = "cdn.${domain}";
portS3 = 8003;
portRpc = 8004;
portWeb = 8004;
portRpc = 8005;
in {
imports = [(self + /modules/nginx.nix)];
@ -33,12 +35,17 @@ in {
s3_region = "garage";
api_bind_addr = "[::1]:${toString portS3}";
root_domain = fqdn;
root_domain = fqdnS3;
};
s3_web = {
bind_addr = "[::1]:${toString portWeb}";
root_domain = fqdnWeb;
};
};
};
services.nginx.virtualHosts.${fqdn} = merge config.services.nginx.sslTemplate {
services.nginx.virtualHosts.${fqdnS3} = merge config.services.nginx.sslTemplate {
locations."/".proxyPass = "http://[::1]:${toString portS3}";
};
}