Skip to content

Upload progress bar significantly delayed when deployed behind CloudflareΒ #5411

@nivetaiyer

Description

@nivetaiyer

Describe the bug
When deploying a Reflex app behind Cloudflare (with HTTPS enabled), the rx.upload(progress=True) component does not show the progress bar until the entire file upload is complete. The handle_upload() function on the backend is not triggered until the full body is received, which delays the start of the progress bar by 10–20 seconds for large files.

This behavior does not occur when the app is run locally (without a reverse proxy), where the progress bar appears immediately and tracks the upload in real time.

To Reproduce
Deploy a Reflex app using rx.upload(progress=True) behind NGINX and Cloudflare (proxy enabled).

Upload a large file (10MB+).

Observe the delayed appearance of the progress bar.

Check DevTools: the /_upload request shows Request Sent duration = 10–20s, with Waiting (TTFB) only starting after the file is fully uploaded.

  • Code/Link to Repo:

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.
https://github.com/user-attachments/assets/6a7c1b01-ac73-4ac3-9cf0-137a77ca9878

Specifics (please complete the following information):

  • Python Version: 3.12
  • Reflex Version: 0.7.13
  • OS: Amazon Linux
  • Browser (Optional): Chrome

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions