Getting error: net::ERR_ABORTED 426, with Shopify app
I have a shopify app hosted on railway, and when calling any of my fetch requests through a proxy, I get a 426 error code. This error doesn't occur in my development environment. I found this post going over a fix: https://community.shopify.com/c/shopify-apps/app-proxy-only-works-with-ngrok-not-when-deployed/td-p/1645712
How can I fix this in railway?
App proxy only works with ngrok, not when deployed
Hello there  I have an app proxy setup which works perfectly fine in dev environment with ngrok.  When I deploy the app to my URL (and change the required settings) the app proxy stops forwarding requests - my server won't receive the request to perform validation and handle it further.  Chrome c...
56 Replies
Project ID:
N/A
N/A
railway does not support requests done with http 1.0, all requests must be at minimum done with http 1.1, this is not configurable
Thanks @Brody , is this something I have to fix on my server side then with my app?
update your app to make requests with http 1.1 minimum
I'll give it a shot, thanks @Brody for confirming it's something on my end
no problem
I'm still struggling with this @Brody 😅 I'm wondering if you can help point me in a certain direction
what is the HTTP protocol railway uses? I know you said a 'minimum of http 1.1'
they will respond to http 1.1 and http 2, with http 1.0 you will get 429 - upgrade required, as you are seeing
what exactly is making these http 1.0 requests?
ok, thank you
I have an app that makes a fetch request to send data to the backend of my app, based on what a site visitor does on a website.
browser fetch, or node fetch?
to capture that, and to keep it secure, the front end makes a fetch request to a proxy server, and then that proxy server makes the actual request
browser fetch first, then to a proxy I have on Shopify
what proxy? nginx, caddy, etc
and in their documentation, they make it seem like they use HTTP/1.1 for their proxy
Shopify has a built in proxy handling
https://shopify.dev/docs/apps/online-store/app-proxies
tbh i did not know you could self host shopify
yeah, that's the only way for now
they don't have app hosting yet
I host one of my apps on railway for the last 4 or 5 months now, but that app didn't do anything that required proxying data and capturing actions visitors took on the customer-facing side of the website
that's what this new app is trying to do
and it works fine on my dev server, it's when i finally push everything to railway that I'm getting the error 426
work through the call chain and see what is making the http 1.0 call
seems like i found this post too:
https://community.shopify.com/c/shopify-apis-and-sdks/app-proxy-making-http-1-0/td-p/1396416
obviously http 1.0 would work on your dev server, but railway has disabled http 1.0 for hopefully obvious reasons
yeah 😛
im shocked that something in 2023 is still sending an http 1.0 request
yeah, I don't know enough about it myself to even pinpoint where the issue is
is there an update to shopify that you could deploy?
it's my first time using a proxy for an app
I'm not sure, let me check on their help slack server
cloudflare will still accept http 1.0, so just put cloudflare in front of your railway app and problem solved
perfect
we have cloudflare, so we were going to try that
I'll get back to you tomorrow and see if it works!
ive just confirmed it
https://devicons-production.up.railway.app/
-> 426
cloudflare -> https://devicons.railway.app/
-> 200great!
code 426 or 429?
lol yeah 426, my bad
you're a lifesaver, I'll get back to you tomorrow and see if this works!
awsome
@Brody were there any specific settings you had to enable for cloudflare to also recognize HTTP 1.0? or just pointed your site to cloudflare?
I didn't setup cloudflare for that site, someone from the team did, and I can't imagine they would have went out of their way to enable http 1.0 support so it must have been enabled by default
cloudflare would be far more equipped to handle potentially unsecure requests, so they probably have it on by default, but as always do your own testing and if you have to enable something then no biggie
ok 🙂
locked, that explains it
haha
i wanted to post my solution in case anyone else had this issue
I must have done that, my mobile app bugged
in cloudflare it has to be set to full and it works, if it is on the default 'flexible' it wasn't working, so selecting full and probably even strict full would work
but i don't want to deal with CA certs, that's the whole reason I'm not using digital ocean's database
that's been a headache
awesome, full is what railway recommends
sorry that I didn't bring up cloudflare sooner
all good! i had brought it up with my project manager a few hours ago as a possible solution, but he was logging off for the day, and we were going through so many possible fixes for the issue, it was forgotten until you mentioned it again!
I'll test it for real tomorrow, for now it's on one of my own domains, but fingers crossed!
let me know if everything is good when you have tested it, I promise I won't accidentally lock this thread again without realising it lmao
haha all good!
It worked on our live url!
yippie
Thanks again @Brody !
happy to help
@Brody hey brody, can you hop on a call with me real quick to discuss some pricing?
I am a conductor
plus I don't have a mic plus I don't like talking
ah, all good 🙂 who would be the best person to chat with? my project manager is trying to compare apples to apples the Digital Ocean app plan vs using railway to host the app, and is concerned about the pricing is all
well it sounds like you should be on the teams plan, I can tell you that much lol
since I get the feeling you are developing a commercial product
yes, ok that helps
then on top of the seat price, you pay for your usage, and usage costs are the same across all plans, so you would likely already have an idea about usage costs
thanks @Brody 🙂
did that clear everything up?
yes! thank you
great! 🙂