servers now have an unique toggle for nginx

This commit is contained in:
2024-08-24 20:55:42 -06:00
parent ad97dcf385
commit fb1a44d2ca
22 changed files with 142 additions and 171 deletions

View File

@@ -4,27 +4,24 @@ in {
options.my.servers.audiobookshelf =
setup.mkOptions "audiobookshelf" "audiobooks" 5687;
config = lib.mkIf config.my.servers.audiobookshelf.enable {
services ={
services = {
audiobookshelf = {
enable = true;
group = "piracy";
port = cfg.port;
};
nginx = {
enable = true;
virtualHosts."${cfg.host}" = proxy {
"/" = {
proxyPass = cfg.local;
extraConfig = ''
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Host $host;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_http_version 1.1;
proxy_redirect http:// https://;
'';
};
nginx.virtualHosts."${cfg.host}" = proxy {
"/" = {
proxyPass = cfg.local;
extraConfig = ''
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Host $host;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_http_version 1.1;
proxy_redirect http:// https://;
'';
};
};
};