CORS/domain issue
I recently moved a domain over to cloudflare, and was hit with some weird api issues, which I think are CORS related. The frontend requests were 404ing and they were being appended to the frontend url automatically, so the 404 was from app.me.com to app.me.com/api.me.com/api/... instead of just api.me.com/api/... Weirdly this only happens on one of my cloudflare hosted websites (I put the same servers on two websites to test). Does anyone have any idea what might be going on? I'm using kubernetes with a frontend and backend deployment.
2 Replies
Sounds like you're using relative urls (ex:
fetch("api.me.com/api/.."
) instead of fully qualifying the url (ex: fetch("https://api.me.com/api/..")
. Shouldn't be anything Cloudflare specific, would need to check html/jsyeah -- what was weird was that we didn't have the issue before cloudflare, but it might have been a typo in our new cluster which we put on cloudflare and then got cached