Is there a way I can trigger the 404 page inside my App Proxy? Just returning a 404 status only shows a blank page.
Topic summary
App Proxy responses that return only an HTTP 404 show a blank page instead of the store’s built-in 404 template.
- One suggested solution is to return Liquid in the App Proxy response and manually render the merchant’s 404 template content. Shopify’s App Proxy can return Liquid, so this can mimic a normal storefront error page.
- That approach was confirmed to work for the original use case.
A later update adds an alternative for apps installed across multiple stores:
- Copying each store’s 404 Liquid is not practical because themes differ between merchants.
- A workaround is to return a 3xx redirect from the app proxy to a non-existent storefront URL, for example
res.redirect('/page-not-found'). - This works because Shopify follows redirects, even though it does not automatically render the 404 template when the proxy itself returns a 404 status.
Outcome: workable solutions were identified; no native direct trigger for the store 404 template from an App Proxy was shown.
Hi @shopjb ,
Here’s a thought you can send Liquid syntax in an App Proxy response. So if you’re able to send 404 why not copy the merchants 404 template code then send it as a response?
Here’s some reference material: https://shopify.dev/tutorials/display-dynamic-store-data-with-app-proxies#proxy-response
Best,
Sam - Owner @ Achieve Applabs
That works. Thanks!
Sending Liquid syntax for 404 didn’t fit our case, because our app is installed on multiple Shopify stores. Different stores may have different 404 Liquid syntax. Since Shopify doesn’t trigger 404 template on 404 status, but follows 3xx redirects, we did a workaround by returning a redirect to a non-existing page
res.redirect('/page-not-found')