websites init + docu revision

This commit is contained in:
Danilo Reyes
2026-02-06 08:13:37 -06:00
parent 893bb199b1
commit 17cd7ba593
11 changed files with 154 additions and 156 deletions

View File

@@ -0,0 +1,42 @@
{
lib,
config,
...
}:
let
cfg = config.my.websites.lidarrMbReport;
mbHeaders = ''
add_header X-Content-Type-Options "nosniff" always;
add_header X-Frame-Options "SAMEORIGIN" always;
'';
in
{
options.my.websites.lidarrMbReport = {
enableProxy = lib.mkEnableOption "lidarr mb report static site";
};
config = lib.mkIf (cfg.enableProxy && config.my.enableProxy) {
services.nginx.virtualHosts."mb-report.lebubu.org" = {
forceSSL = true;
enableACME = true;
root = "/var/www/html/lidarr-mb-gap";
locations = {
"/" = {
extraConfig = ''
try_files $uri /missing_albums.html;
'';
};
"~* \\.html$" = {
extraConfig = ''
add_header Content-Type "text/html; charset=utf-8";
'';
};
"~* \\.json$" = {
extraConfig = ''
add_header Content-Type "application/json";
'';
};
};
extraConfig = mbHeaders;
};
};
}