Shopify App Proxy 404 Mystery: When Your Server Works, But Shopify Doesn't Connect
Hey fellow store owners and developers!
Ever hit that frustrating wall where your custom app's backend server is humming along beautifully, publicly accessible, and responding perfectly to direct requests, but Shopify's App Proxy just gives you a cold shoulder with a persistent 404 error? You're definitely not alone. We recently saw a fantastic, detailed breakdown of this exact head-scratcher from a community member named Hirohiro, and it's a prime example of a tricky issue that often leaves developers scratching their heads.
Hirohiro's post was a masterclass in problem isolation, and it brings up a critical point about how Shopify's internal routing infrastructure interacts with our app backends. Let's dive into what Hirohiro shared and what we can learn from it.
The Head-Scratcher: App Proxy 404, Direct Access 200 OK
Hirohiro was building a custom Shopify app using Laravel and encountered a critical issue: their App Proxy consistently returned a 404 error when accessed via the storefront. What's even more puzzling is that these requests never even reached their AWS server. Their AWS ALB and Nginx access logs remained completely silent when the proxy was hit.
Hirohiro's Setup & The Problem in Detail:
- App Proxy Configuration:
- Subpath prefix:
apps - Subpath:
my-app-subpath - Proxy URL:
https://sub.example.com/front
- Subpath prefix:
- The Symptom: Accessing
https://[my-shop-domain].myshopify.com/apps/my-app-subpathalways resulted in a404 (Not Found)error in the browser console, with no corresponding log entries on their server.
The Conclusive Test: Bypassing Shopify's Proxy
This is where Hirohiro's troubleshooting really shone. To isolate the issue, they performed a direct test, completely bypassing Shopify's proxy:
- Direct URL Tested:
https://sub.example.com/front/dummy_customer_id - Result: It worked perfectly! The page rendered fine, and crucially, their Nginx logs immediately captured the request with a
200 OK.
This direct test was a game-changer because it definitively ruled out any issues on their AWS server side — no firewall, AWS WAF, security group, or Nginx misconfigurations. Their server was live, publicly accessible, and working flawlessly. They even confirmed Shopify's general reachability by noting another app variant using a CloudFlare tunnel on the same infrastructure worked fine.
The Hypothesis: A Frozen Shopify Routing Cache?
Given these results, Hirohiro's hypothesis was compelling: the fact that the server was 100% reachable directly, but completely invisible (0 logs) when requested through the Shopify proxy, suggested that Shopify's proxy server was dropping the traffic internally before it even attempted to forward the packet to the configured Proxy URL.
They speculated that Shopify's internal routing table or cache for this specific app might have become 'frozen' or 'corrupted,' especially since the dev environment server had been down for a few months. This is a brilliant insight because it points to an internal Shopify system issue rather than an external server problem.
So, What Can You Do When Shopify's App Proxy Seems 'Stuck'?
When you've done all your due diligence, and your server is clearly working, but Shopify's proxy isn't playing along, here are the expert steps to take, inspired by Hirohiro's thorough analysis:
-
Double-Check Your App Proxy Configuration (Yes, Again!)
Sometimes, the smallest detail can make a difference. Even if you're sure it's correct, go back to your Partner Dashboard and carefully review the App Proxy settings for your app. Look for:
- Subpath prefix: Is it exactly
appsora(if you chose the shorter option)? - Subpath: Is
my-app-subpath(or whatever you've chosen) spelled correctly and consistently? - Proxy URL: This is critical. Ensure it's the exact root URL that Shopify should hit. Hirohiro's example used
https://sub.example.com/front. Pay attention to trailing slashes — sometimes adding or removing one can trigger a refresh or resolve an unexpected routing issue. For instance, if your backend expects/front/, make sure your Proxy URL reflects that, or your server handles the redirect gracefully.
Even just re-saving the configuration without changes can sometimes force a refresh on Shopify's end, similar to clearing a browser cache.
- Subpath prefix: Is it exactly
-
Contact Shopify Support with Comprehensive Details
This is often the most direct path to resolution for internal routing issues. When you contact them, provide all the fantastic details Hirohiro included:
- Your shop domain and app name.
- The exact App Proxy configuration (subpath prefix, subpath, proxy URL).
- The storefront URL that returns the 404 (e.g.,
https://[my-shop-domain].myshopify.com/apps/my-app-subpath). - The direct URL to your server that works perfectly (e.g.,
https://sub.example.com/front/dummy_customer_id). - Emphasize that no requests are reaching your server's access logs when accessed via the Shopify proxy.
- Mention your hypothesis about a potential internal routing cache issue.
The more data you provide, the quicker their engineers can investigate the internal routing state for your proxy setup.
-
Consider a Temporary 'New' Proxy Path (for Testing Cache Theory)
If you suspect a cache issue specific to your existing subpath, try setting up a brand new App Proxy entry in your Partner Dashboard. Use a slightly different, unique subpath (e.g.,
my-app-subpath-test) but point it to the exact same backend Proxy URL (https://sub.example.com/front). If this new test path works, it strongly supports the theory that the original subpath's routing configuration is indeed 'stuck' or cached incorrectly within Shopify's system. -
Review App Installation & Re-authentication (Carefully)
While less common for a routing issue, sometimes an app's internal state can be reset by a fresh installation. If you have a development store, you could try uninstalling and reinstalling the app there. This is a more drastic step and should be approached with caution in a live environment, but it can sometimes clear out old configurations. Make sure to back up any app-related data if you go this route.
-
Check for Unintended Redirects or 'Catch-Alls' on Your Server
Even though your direct URL works, sometimes proxies can behave differently. Ensure your
/frontendpoint isn't doing any unexpected HTTP redirects (e.g., 301, 302) that Shopify's proxy might not follow correctly or might interpret as a new, unproxied URL. While Hirohiro's logs were empty, a very quick, internal redirect could potentially cause issues before it hits external logs.
Hirohiro's detailed problem description really highlights the importance of thorough testing and clear communication when dealing with platform-specific routing challenges. When your server is demonstrably working, the focus shifts to the intermediary — in this case, Shopify's App Proxy. Don't hesitate to leverage their support with all the data you've gathered. It makes their job, and your path to resolution, much smoother. Hopefully, these steps help anyone else encountering this particular brand of Shopify App Proxy puzzlement!