Issue Description:
I’m experiencing an issue with Shopify App Proxy configuration where the proxy settings are not automatically updating based on my shopify.app.toml file.
Problem:
-
When checking the App proxy settings in the Shopify admin panel (Store → App → Apps and sales channels → App proxy), the configuration doesn’t match what’s defined in my shopify.app.toml file.
-
This mismatch results in 404 errors when trying to fetch data from my server through the app proxy.
Current Workarounds:
The proxy works correctly only after either:
Question:
- How can I maintain backward compatibility for current users without requiring manual intervention or app reinstallation?
Any help or guidance would be greatly appreciated. Thank you!
1 Like
Hey @oribenez
The merchant customizing the app proxy subpath is actually expected behavior. This feature allows merchants to create more user-friendly URLs that appear to originate from their own domain, giving them control over how these paths appear to their customers. Merchants can toggle between different subpath prefixes (/apps, /a, /community, or /tools) and customize the subpath to better fit their store’s navigation structure. You can learn more about this in our documentation: Display dynamic store data with app proxies.
To handle this your app should be able to work dynamically with the path_prefix
parameter sent. This ensures your app remains flexible and continues to work properly regardless of how merchants customize their proxy paths. Documentation here: Handling Proxy Requests
If you’re using the remix template, this guide may help as well App proxy
Hi @KyleG-Shopify
Thank you for your help.
I understand now the reasons that stands behind the app proxy mechanism.
The path_prefix
is added by shopify and can be seen after the request has been proxied to my server. How can I know the path prefix before sending the request?
In other words, how can my theme-app-extension know which path_prefix
to use, in order for my request to arrive to it’s destination (my backend server),
what is the URL that I should write in the fetch function, if I use the one that has been saved in the shopify.app.toml
it is not reliable cause it can be changed by the user.
Can I get the path prefix of the app from admin api / or with liquid?(if “yes”, I can embed it later on my theme app extension)?
My setup: Express server.
Also want to mention I’ve looked up reading carefully all the docs files, maybe I’m missing something…
Thanks.