Ui to backened API call - backend URL is getting "undefined" added

Hello Everyone - I recently started configuring cloudflare for my web app. MY web app is a simple one. The UI is reactJs and backend is node+express. Both these are deployed on an Ubuntu VPS on hostinger and I have nginx acting as a reverse proxy. Without the Cloudflare, everything was working fine but when I introduced Cloudflare, the UI to backend calls are all failing and that is because normally the backend API URL would be /api/v1/my-api but now all the backend calls are like /undefined/api/v1/my-api
Assuming my web url is mywebsite.com is available for purchase - Sedo.com
I am expecting the backend api calls from ui to be mywebsite.com is available for purchase - Sedo.com but currently the api URIs are getting modified like mywebsite.com is available for purchase - Sedo.com and things are falling. Any help or pointers to resolve this?

Assuming my web url is mywebsite.com is available for purchase - Sedo.com
I am expecting the backend api calls from ui to be mywebsite.com is available for purchase - Sedo.com but currently the api URIs are getting modified like mywebsite.com is available for purchase - Sedo.com and things are falling. Any help or pointers to resolve this?

I solved it myself by specifying absolute URLs for my backend. thank you.