Configure Nginx virtual host for audiobookshelf
This commit is contained in:
parent
8baa3ea1cb
commit
e1c30789a2
3 changed files with 27 additions and 2 deletions
|
@ -14,6 +14,7 @@
|
||||||
|
|
||||||
extraDomainNames = [
|
extraDomainNames = [
|
||||||
"2020.oliverdavies.uk"
|
"2020.oliverdavies.uk"
|
||||||
|
"audiobookshelf.oliverdavies.uk"
|
||||||
"bootstrap-with-tailwind.oliverdavies.uk"
|
"bootstrap-with-tailwind.oliverdavies.uk"
|
||||||
"code.oliverdavies.uk"
|
"code.oliverdavies.uk"
|
||||||
"eric.oliverdavies.uk"
|
"eric.oliverdavies.uk"
|
||||||
|
|
|
@ -1,5 +1,8 @@
|
||||||
{ config, ... }:
|
{ config, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
cfg = config.services.audiobookshelf;
|
||||||
|
in
|
||||||
{
|
{
|
||||||
services = {
|
services = {
|
||||||
audiobookshelf = {
|
audiobookshelf = {
|
||||||
|
@ -8,10 +11,22 @@
|
||||||
port = 4001;
|
port = 4001;
|
||||||
};
|
};
|
||||||
|
|
||||||
caddy.virtualHosts."audiobookshelf.oliverdavies.uk" = {
|
nginx.virtualHosts."audiobookshelf.oliverdavies.uk" = {
|
||||||
|
forceSSL = true;
|
||||||
useACMEHost = "oliverdavies.uk";
|
useACMEHost = "oliverdavies.uk";
|
||||||
|
|
||||||
extraConfig = "reverse_proxy localhost:${toString config.services.audiobookshelf.port}";
|
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;
|
||||||
|
'';
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,6 +11,15 @@
|
||||||
siteMonitor = "http://localhost:8096";
|
siteMonitor = "http://localhost:8096";
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
"Audiobookshelf" = {
|
||||||
|
href = "https://audiobookshelf.oliverdavies.uk";
|
||||||
|
icon = "audiobookshelf";
|
||||||
|
description = "Self-hosted audiobook and podcast server";
|
||||||
|
siteMonitor = "http://localhost:4001";
|
||||||
|
};
|
||||||
|
}
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue