❄️ Nix configurations
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107{ pkgs, ... }:
{ /* Plex Media Server requires the media.nix ! */
services.plex = { enable = true; openFirewall = true; user = "media"; group = "media"; };
services.traefik.dynamicConfigOptions = { http = { middlewares = { plex-headers = { headers = { customRequestHeaders = { X-Real-IP = "{ClientIP}"; X-Forwarded-For = "{ClientIP}"; X-Forwarded-Proto = "https"; Host = "plex.otter.place"; Referer = "plex.otter.place"; Origin = "plex.otter.place"; X-Plex-Client-Identifier = ""; X-Plex-Device = ""; X-Plex-Device-Name = ""; X-Plex-Platform = ""; X-Plex-Platform-Version = ""; X-Plex-Product = ""; X-Plex-Token = ""; X-Plex-Version = ""; X-Plex-Nocache = ""; X-Plex-Provides = ""; X-Plex-Device-Vendor = ""; X-Plex-Model = ""; }; }; };
plex-compress = { compress = { excludedContentTypes = [ "video/*" "audio/*" "image/*" ]; minResponseBodyBytes = 1000; }; }; };
serversTransports.plex-transport.forwardingTimeouts = { dialTimeout = "30s"; responseHeaderTimeout = "6000s"; idleConnTimeout = "6000s"; };
routers = { plex = { entryPoints = [ "websecure" ]; rule = "Host(`plex.otter.place`)"; service = "plex"; middlewares = [ "plex-headers" "plex-compress" ]; tls = { certResolver = "letsencrypt"; options = "plex-tls"; }; }; };
services = { plex = { loadBalancer = { servers = [{ url = "http://localhost:32400"; }]; responseForwarding = { flushInterval = "1ms"; }; serversTransport = "plex-transport"; healthCheck = { path = "/web/index.html"; interval = "30s"; timeout = "10s"; scheme = "http"; }; }; }; }; };
tls = { options = { plex-tls = { minVersion = "VersionTLS10"; maxVersion = "VersionTLS12"; preferServerCipherSuites = true; cipherSuites = [ "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256" "TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384" "TLS_RSA_WITH_AES_128_GCM_SHA256" "TLS_RSA_WITH_AES_256_GCM_SHA384" ]; }; }; }; };}