Skip to content

Conversation

@Vadko
Copy link

@Vadko Vadko commented Jan 3, 2026

Changes

When downloading large files (1GB+) from Supabase Storage, Kong buffers the response to a temporary file. This causes upstream prematurely closed connection errors during long-running downloads.

Kong logs show:
[warn] an upstream response is buffered to a temporary file /usr/local/kong/proxy_temp/...
[error] upstream prematurely closed connection while reading upstream

Solution

Disable request/response buffering and increase timeouts for the storage-v1 service:

  • response_buffering: false - stream directly to client without buffering
  • request_buffering: false - stream uploads without buffering
  • read_timeout: 3600 - 1 hour for large downloads
  • write_timeout: 3600 - 1 hour for large uploads

Settings are configurable via environment variables with sensible defaults.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant