Website not pointend to server with cloudflare proxy

the website has an issue with the Cloudflare proxy it works fine and points to the server without Cloudflare proxy but when I use Cloudflare proxy sometime the traffic goes to the server and sometimes it shows gateway time out, and there is no load in the server RAM is free server resources are free, please help me out