masive rewriting and setup of server files
This commit is contained in:
@@ -10,14 +10,15 @@ let
|
||||
in
|
||||
{
|
||||
options.my.servers.audiobookshelf = setup.mkOptions "audiobookshelf" "audiobooks" 5687;
|
||||
config = lib.mkIf config.my.servers.audiobookshelf.enable {
|
||||
config = {
|
||||
networking.firewall.allowedTCPPorts = lib.mkIf (!cfg.isLocal) [ cfg.port ];
|
||||
services = {
|
||||
audiobookshelf = {
|
||||
audiobookshelf = lib.mkIf cfg.enable {
|
||||
inherit (cfg) port;
|
||||
enable = true;
|
||||
group = "piracy";
|
||||
port = cfg.port;
|
||||
};
|
||||
nginx.virtualHosts."${cfg.host}" = proxy {
|
||||
nginx.virtualHosts."${cfg.host}" = lib.mkIf cfg.enableProxy (proxy {
|
||||
"/" = {
|
||||
proxyPass = cfg.local;
|
||||
extraConfig = ''
|
||||
@@ -26,11 +27,11 @@ in
|
||||
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://;
|
||||
proxy_http_version 1.1;
|
||||
proxy_redirect http:// https://;
|
||||
'';
|
||||
};
|
||||
};
|
||||
});
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user