jellyfin cache nginx
This commit is contained in:
parent
c62caf46d3
commit
fa7b646b8e
|
@ -13,34 +13,45 @@ in {
|
||||||
group = "media";
|
group = "media";
|
||||||
};
|
};
|
||||||
|
|
||||||
nginx.virtualHosts = {
|
nginx = {
|
||||||
"jellyfin.sako.box" = {
|
proxyCachePath."jellyfin" = {
|
||||||
forceSSL = true;
|
enable = true;
|
||||||
sslCertificate = "/srv/secrets/certs/sako.box.pem";
|
levels = "1:2";
|
||||||
sslCertificateKey = "/srv/secrets/certs/sako.box-key.pem";
|
inactive = "1w";
|
||||||
extraConfig = ''
|
maxSize = "5g";
|
||||||
add_header X-Frame-Options "SAMEORIGIN";
|
useTempPath = false;
|
||||||
add_header X-Content-Type-Options "nosniff";
|
keysZoneName = "jellyfin_cache";
|
||||||
add_header Permissions-Policy "accelerometer=(), ambient-light-sensor=(), battery=(), bluetooth=(), camera=(), clipboard-read=(), display-capture=(), document-domain=(), encrypted-media=(), gamepad=(), geolocation=(), gyroscope=(), hid=(), idle-detection=(), interest-cohort=(), keyboard-map=(), local-fonts=(), magnetometer=(), microphone=(), payment=(), publickey-credentials-get=(), serial=(), sync-xhr=(), usb=(), xr-spatial-tracking=()" always;
|
keysZoneSize = "10m";
|
||||||
add_header Content-Security-Policy "default-src https: data: blob: ; img-src 'self' https://* ; style-src 'self' 'unsafe-inline'; script-src 'self' 'unsafe-inline' https://www.gstatic.com https://www.youtube.com blob:; worker-src 'self' blob:; connect-src 'self'; object-src 'none'; frame-ancestors 'self'";
|
};
|
||||||
|
virtualHosts = {
|
||||||
|
"jellyfin.sako.box" = {
|
||||||
|
forceSSL = true;
|
||||||
|
sslCertificate = "/srv/secrets/certs/sako.box.pem";
|
||||||
|
sslCertificateKey = "/srv/secrets/certs/sako.box-key.pem";
|
||||||
|
extraConfig = ''
|
||||||
|
add_header X-Frame-Options "SAMEORIGIN";
|
||||||
|
add_header X-Content-Type-Options "nosniff";
|
||||||
|
add_header Permissions-Policy "accelerometer=(), ambient-light-sensor=(), battery=(), bluetooth=(), camera=(), clipboard-read=(), display-capture=(), document-domain=(), encrypted-media=(), gamepad=(), geolocation=(), gyroscope=(), hid=(), idle-detection=(), interest-cohort=(), keyboard-map=(), local-fonts=(), magnetometer=(), microphone=(), payment=(), publickey-credentials-get=(), serial=(), sync-xhr=(), usb=(), xr-spatial-tracking=()" always;
|
||||||
|
add_header Content-Security-Policy "default-src https: data: blob: ; img-src 'self' https://* ; style-src 'self' 'unsafe-inline'; script-src 'self' 'unsafe-inline' https://www.gstatic.com https://www.youtube.com blob:; worker-src 'self' blob:; connect-src 'self'; object-src 'none'; frame-ancestors 'self'";
|
||||||
|
|
||||||
'';
|
'';
|
||||||
locations = {
|
locations = {
|
||||||
"/" = {
|
"/" = {
|
||||||
proxyPass = "http://localhost:8096";
|
proxyPass = "http://localhost:8096";
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
# Disable buffering when the nginx proxy gets very resource heavy upon streaming
|
# Disable buffering when the nginx proxy gets very resource heavy upon streaming
|
||||||
proxy_buffering off;
|
proxy_buffering off;
|
||||||
'';
|
proxy_cache jellyfin_cache;
|
||||||
};
|
'';
|
||||||
"/socket" = {
|
};
|
||||||
proxyPass = "http://localhost:8096";
|
"/socket" = {
|
||||||
proxyWebsockets = true;
|
proxyPass = "http://localhost:8096";
|
||||||
|
proxyWebsockets = true;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue