Thank you for your answer!
This is what I set in the app configuration in the shopify partners App config:
The hmac request seems to point to the correct url:
reverse | 172.18.0.1 - - [26/Jun/2019:08:07:50 +0000] "GET /shopify/?hmac=SNIPPED&locale=en-CH&shop=dev-store.myshopify.com×tamp=1561536469 HTTP/1.1" 302 113 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.100 Safari/537.36"
but the auth request is then done on the root of the ngrok.io url:
reverse | 172.18.0.1 - - [26/Jun/2019:08:07:52 +0000] "GET /auth?shop=dev-store.myshopify.com HTTP/1.1" 200 26596 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.100 Safari/537.36"
I’m using the example project from github.
I set the following according to your suggestion:
createShopifyAuth({
apiKey: SHOPIFY_API_KEY,
secret: SHOPIFY_API_SECRET_KEY,
scopes: ['read_products', 'write_products'],
prefix: "/shopify",
This is the setup for my local nginx reverse proxy (one app is running on port 7000, which should the root of the ngrok. The shopify app is running on port 3000 and should be mapped to /shopify) :
events {}
http {
server {
listen 80;
server_name dev.local;
#different app running on local port
location / {
proxy_pass http://192.168.0.87:7000/;
}
location /shopify/ {
proxy_pass http://192.168.0.87:3000/shopify/;
proxy_set_header HOST $host;
proxy_set_header Referer $http_referer;
}
}
}
I could only make it work by forwarding /auth to the shopify app as well:
location /auth {
proxy_pass http://192.168.0.87:3000/auth;
proxy_set_header HOST $host;
}
Currently I think this could be a bug in the way Shopify handles the sub-paths. I’m still thankful for any pointers though!
