modularization of all servers donion rings
This commit is contained in:
31
modules/servers/audiobookshelf.nix
Normal file
31
modules/servers/audiobookshelf.nix
Normal file
@@ -0,0 +1,31 @@
|
||||
{ lib, config, proxy, ... }: {
|
||||
options.my.servers.audiobookshelf.enable = lib.mkEnableOption "enable";
|
||||
config = lib.mkIf config.my.servers.audiobookshelf.enable {
|
||||
services = {
|
||||
audiobookshelf = {
|
||||
enable = true;
|
||||
group = "piracy";
|
||||
port = 5687;
|
||||
};
|
||||
nginx = {
|
||||
enable = true;
|
||||
virtualHosts."audiobooks.${config.my.domain}" = proxy {
|
||||
"/" = {
|
||||
proxyPass = "http://${config.my.localhost}:${
|
||||
toString config.services.audiobookshelf.port
|
||||
}";
|
||||
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://;
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user