I had this exact same issue. After hours of troubleshooting, I found that it was a directive in my .htaccess file that was causing the issue. This is what it looked like before:
# Redirect Trailing Slashes...
RewriteRule ^(.*)/$ /$1 [L,R=301]
When I changed it to the below, the proxy page rendered correctly:
# Redirect Trailing Slashes...
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)/$ /$1 [L,R=301]
Hope that helps!
Edit:
Note also that if you're not requesting a file (ex: proxy.php), but using a directory (ex: http://yourdomain.com/proxy
) that the request to the server includes the trailing slash (meaning that Shopify's proxy requests http://yourdomain.com/proxy/
). 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.