Cloudflare Access doesn't work with Mediawiki Visual Editor

I have just install mediawiki latest version and create an access rule on Cloudflare. Everything works great until I install the visual editor extension. Everytime I try to use it, it will return Error contacting the Parsoid /RESTBase server. Upon further testing, I found out that even though I already authenticated when I first access the site, when the visual editor send a get request to https://domain/api.php?action=visualeditor&format=json&paction=parse&page=Main_Page&uselang=en-gb&formatversion=2,
the response is the Cloudflare access page asking for a verification code.
by deleting the access rule, the visual editor works again. I already tried to add Cloudflare ip address range to the bypass rule but still no success. Any ideas?

Turns out that I have to whitelist my server IP instead of Cloudflare one!