mirror of
https://github.com/RGBCube/ncc
synced 2025-07-29 11:07:44 +00:00
fix: make cache serve s3 actually
This commit is contained in:
parent
31bf6bc062
commit
6c42f34c45
2 changed files with 13 additions and 6 deletions
|
@ -9,10 +9,10 @@ in {
|
||||||
services.nginx.virtualHosts.${fqdn} = merge config.services.nginx.sslTemplate {
|
services.nginx.virtualHosts.${fqdn} = merge config.services.nginx.sslTemplate {
|
||||||
locations."/" = {
|
locations."/" = {
|
||||||
extraConfig = /* nginx */ ''
|
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}";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,9 +2,11 @@
|
||||||
inherit (config.networking) domain;
|
inherit (config.networking) domain;
|
||||||
inherit (lib) enabled merge;
|
inherit (lib) enabled merge;
|
||||||
|
|
||||||
fqdn = "s3.${domain}";
|
fqdnS3 = "s3.${domain}";
|
||||||
|
fqdnWeb = "cdn.${domain}";
|
||||||
portS3 = 8003;
|
portS3 = 8003;
|
||||||
portRpc = 8004;
|
portWeb = 8004;
|
||||||
|
portRpc = 8005;
|
||||||
in {
|
in {
|
||||||
imports = [(self + /modules/nginx.nix)];
|
imports = [(self + /modules/nginx.nix)];
|
||||||
|
|
||||||
|
@ -33,12 +35,17 @@ in {
|
||||||
s3_region = "garage";
|
s3_region = "garage";
|
||||||
|
|
||||||
api_bind_addr = "[::1]:${toString portS3}";
|
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}";
|
locations."/".proxyPass = "http://[::1]:${toString portS3}";
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue