App Proxy Problem

Solved

App Proxy Problem

HunkyBill
Shopify Partner
4853 60 562

For my Custom App, I access the Online Store aspect of Extensions and turn on App Proxy. I am careful here to set three things.

1. I choose tools from the Subpath Prefix

2. I set the Subpath to be fuzzywuzzy

3. I set the Proxy URL to be https://myapp.ngrok.io/fuzzywuzzy

My App accepts incoming calls from Shopify at https://myapp.ngrok.io so I would expect the router to be triggered for a GET or POST to /fuzzywuzzy

I navigate to the merchant shop with this App installed. I open up any page and access the console. I find jQuery available so I do a quick $.get('/tools/fuzzywuzzy') and Shopify returns me an error telling me I cannot access https://theshop.myshopify.com/fuzzywuzzy. Of course.. that is not a Proxied URL.

That tells me the App Proxy is not being handled by Shopify. Why? It is saved in the App, and should work. What else has to happen here to make the Proxy exchange with the backend?

 

Custom Shopify Apps built just for you! [email protected] http://www.resistorsoftware.com
Accepted Solution (1)
HunkyBill
Shopify Partner
4853 60 562

This is an accepted solution.

Not sure why it would matter. the https://mystore.myshopify.com/tools/fuzzywuzzy fails 404 same as the standard /tools/fuzzywuzzy call I always use with all my other Proxy setups.

OK. So I inspected the response, in detail. It seems it was me the dummy. I forgot that the header would be mystore.myshopify.com and my App was set to block that, which is the actual response. My App telling me to screw off. Sigh... some things never get old, like App Proxies!

 

Custom Shopify Apps built just for you! [email protected] http://www.resistorsoftware.com

View solution in original post

Replies 2 (2)

Gregarican
Shopify Partner
1033 86 292

Here is how I have my app proxy defined.

Untitled.png

Then in my production system I call through it by hitting this URL --> https://MY_SHOPIFY_SHOP.myshopify.com/apps/dch-webapi. As you can see, just the subpath prefix and subpath are appended to the Shopify shop's URL. All of the Proxy URL stuff is hidden from the call. Does this help any?

HunkyBill
Shopify Partner
4853 60 562

This is an accepted solution.

Not sure why it would matter. the https://mystore.myshopify.com/tools/fuzzywuzzy fails 404 same as the standard /tools/fuzzywuzzy call I always use with all my other Proxy setups.

OK. So I inspected the response, in detail. It seems it was me the dummy. I forgot that the header would be mystore.myshopify.com and my App was set to block that, which is the actual response. My App telling me to screw off. Sigh... some things never get old, like App Proxies!

 

Custom Shopify Apps built just for you! [email protected] http://www.resistorsoftware.com