I’m building an embedded app and trying to get the App Proxy option to render a liquid page to work. I have set up the proxy correctly in the app, and have the file returning a “Content-Type: application/liquid” header, but when I access the page in my test store, it simply downloads the file.
Quick update. I have it working if the file is on a different server. The server configurations are different so I’m trying to narrow down what configuration issue is causing the problem.
Here are the headers output by the server that isn’t working:
Wow, ok, after a great many hours troubleshooting, I fixed this issue. It had to do with a directive I had in my htaccess file. Specifically, it looked like:
Note also that if you’re not requesting a file (ex: test.php in my case), but using a directory (ex: http://yourdomain.com/test) that the request to the server includes the trailing slash (meaning that Shopify’s proxy requests http://yourdomain.com/test/). The htaccess file issues a 301 redirect, which is forcing Shopify to download the file instead of interpret it as liquid. To fix that issue, you might add another rewrite condition that excludes those domains from being redirect to their “non-trailing-slash” counterparts.
Okay, I needed to read that carefully a few times and the comment on trailing slashes makes sense to me now. Also, for testing clearing the browser cache is required to see the desired result.
I’m having the same issue with my file being served for download instead of rendering the liquid code. However, my embedded app is hosted on Heroku, which means I don’t have access to a .htaccess file. Any suggestions?
I know this reply is very late, but I recently encountered this issue when attempting to set up my app hosted on Heroku.
The issue seems to be that some servers, including Heroku, seem to have some settings that creates a file for download instead of passing the response back to Shopify for rendering. Like Charlotte indicated, this has to do with the settings in the htaccess file. If you have the ability to edit these settings, then this issue should get resolved by following the steps she outlined.
I also had this issue. It isn’t exactly clear what I did to resolve it. However after it had been resolved Shopify seemed to be serving me a cached page in my browser which prevented me from realizing it was resolved for quite some time.
If you are accessing a Proxy URL and you want to test your fix is in place, try appending something unique to the query string to allow for a fresh test.