Hi fellow developers,
We’re running into a strange issue with the App Proxy when handling image uploads from a theme extension.
Context:
-
Frontend: Theme App Extension, uses fetch to POST multipart/form-data (with a ~1-2MB image file) to the App Proxy path.
-
App Proxy Config: Prefix apps, Subpath xyz, Proxy URL https://.fly.dev (base hostname). Target URL from JS is /apps/xyz/process-image?shop=…
-
Backend: Remix app hosted externally (on Fly.io).
The Problem:
The fetch request from the theme extension consistently results in a 500 Internal Server Error in the browser.
-
Browser console shows the request being initiated correctly to the /apps/… path.
-
Backend server logs (at the earliest possible entry point, before any Remix routing) show that this specific POST request never arrives .
-
The backend server is running and successfully handles other requests (like GETs for health checks or loading the app in Admin).
What We’ve Ruled Out:
-
App Proxy Config: We’ve confirmed the Proxy URL points to the correct base hostname of our backend server.
-
Backend Server Issues: The server is stable, running, responding to other requests, and we’ve fixed previous unrelated startup problems. Scaling server resources didn’t help.
-
Backend Code: Tested with a minimal backend handler for the route; the request still doesn’t arrive.
Hypothesis:
Since the request leaves the browser destined for the App Proxy path, but never reaches our backend’s entry point (while other requests do), we suspect the issue might be occurring within the Shopify App Proxy forwarding layer itself, specifically when dealing with multipart/form-data POST requests containing files.
Questions:
-
Has anyone experienced the App Proxy seemingly dropping or failing to forward multipart/form-data POST requests, especially those with files around 1-2MB?
-
Are there known limitations, header requirements, or specific behaviors of the App Proxy when handling multipart/form-data compared to regular POSTs or GETs?
-
Does the App Proxy potentially impose size limits or timeouts before it even attempts to forward the request to the configured Proxy URL?
-
Is there any way to get visibility or debug information on how the App Proxy processes a specific request before forwarding it?
It feels like the request is getting lost within Shopify’s infrastructure. Any tips for debugging App Proxy forwarding for file uploads would be greatly appreciated!
Thanks!