diff --git a/modules/nginx.nix b/modules/nginx.nix index 1cbb93b..1f0f8c2 100644 --- a/modules/nginx.nix +++ b/modules/nginx.nix @@ -244,9 +244,42 @@ in "media.atri.dad" = { enableACME = true; forceSSL = true; + extraConfig = '' + # No file size limits for Jellyfin + client_max_body_size 0; + + # Disable buffering for streaming + proxy_buffering off; + proxy_request_buffering off; + ''; locations."/" = { proxyPass = "http://lloyd.tadpole-pain.ts.net:30013"; - extraConfig = "if ($fuckai) { return 444; }"; + proxyWebsockets = true; + extraConfig = '' + if ($fuckai) { return 444; } + + # Disable transfer limits and timeouts for large media + proxy_read_timeout 86400s; + proxy_send_timeout 86400s; + send_timeout 86400s; + client_max_body_size 0; + + # Disable buffering for real-time streaming + proxy_buffering off; + proxy_request_buffering off; + proxy_http_version 1.1; + + # Proper headers for streaming + proxy_set_header Range $http_range; + proxy_set_header If-Range $http_if_range; + ''; + }; + locations."/socket" = { + proxyPass = "http://lloyd.tadpole-pain.ts.net:30013"; + proxyWebsockets = true; + extraConfig = '' + if ($fuckai) { return 444; } + ''; }; }; "memos.atri.dad" = {