nix-config/hosts/nixedo/modules/audiobookshelf.nix

33 lines
751 B
Nix
Raw Normal View History

2025-04-19 11:45:23 +01:00
{ config, ... }:
2024-12-14 20:19:42 +00:00
let
cfg = config.services.audiobookshelf;
in
2024-12-14 20:19:42 +00:00
{
2025-04-19 11:45:23 +01:00
services = {
audiobookshelf = {
enable = true;
2024-12-26 00:13:42 +00:00
2025-04-19 11:45:23 +01:00
port = 4001;
};
2024-12-14 20:19:42 +00:00
nginx.virtualHosts."audiobookshelf.oliverdavies.uk" = {
forceSSL = true;
2025-04-19 11:45:23 +01:00
useACMEHost = "oliverdavies.uk";
2024-12-14 20:19:42 +00:00
locations."/" = {
proxyPass = "http://localhost:${toString cfg.port}";
extraConfig = ''
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $http_host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Protocol $scheme;
proxy_set_header X-Real-IP $remote_addr;
'';
};
2024-12-14 20:19:42 +00:00
};
};
}