When you change document root, apache has to be restarted. Caching no longer in affect as that was your moodle. A simple index.html doesn't do any query of any backend DB to acquire data to ship to your brower.
With CloudFlare in-between, as it would be with DNS, that would be cached by CF and that access (index.html is what ... 1K at the most?) should be extremely fast - would imagine all of your Moodle users could access that static html page at the same time! Remember though, that access would stop at CF and be returned to all the clients accessing ... would never reach your Moodle server on Amazon.
So when you do that test of switching document root, what do you use as a URL in the browser you are using? https://IP/ or https://FQDN/
iP would attempt going directly to Amazon ... FQDN would run through CloudFlare ... never reach your Amazon server and what you get back is the cached page from CF's content delivery caching.
In order to test if it's CF issue, is to change DNS such that your FQDN doesn't return a CF route but the true Amazon IP of your web service. CF then taken out of the path to your Moodle. That kinda change would/might take a while for the DNS change to get refreshed in DNS servers.
Your moodle has a config.php file. One of the requirements of that file and clean interaction with your moodle, is the $CFG->wwwroot value ... a URL.
Moodle doesn't like relative addressing ... matterof fact the above value is used to record rows in tables of your DB to local (to your Moodle) resources ... like admin links.
In all of this, you've not really shared any info about DB server. Is that localhost in your config.php file or is it a DB server in Amazon's network?
And since a database is involved with Moodle, have you ever tweaked any DB server settings? Typical adjustments on a standalone ... meaning any/all of anything releated to moodle is on the same server (not split) ... are
skip-name-resolve
innodb_buffer_pool_size
innodb_buffer_pool_instances
max_allowed_packet
Don't ask what those valuies should be with your really un-known setup.
Suggest installing MySQLTuner.PL on web server and run it from there to see what recommendations it might have for tweaking.
Just now I did a traceroute from my location to your Moodle server. Once by IP and once by FQDN.
In both they get to a hop on 52.94.35.x which goes to 52.94.33.x on the Amazon's network.
A cliip:
15 * * *
16 52.94.35.91 (52.94.35.91) 138.250 ms
52.94.35.83 (52.94.35.83) 142.833 ms
52.94.35.121 (52.94.35.121) 131.800 ms
17 52.94.35.64 (52.94.35.64) 129.890 ms
52.94.35.116 (52.94.35.116) 127.939 ms
52.94.35.110 (52.94.35.110) 130.474 ms
18 52.94.33.173 (52.94.33.173) 127.359 ms 127.290 ms
52.94.33.167 (52.94.33.167) 138.500 ms
19 52.94.33.2 (52.94.33.2) 130.340 ms
52.94.33.14 (52.94.33.14) 130.810 ms
52.94.33.2 (52.94.33.2) 130.543 ms
The ms times expected as am in SA USA. but speed is of the essence, yes?
If you note, at every hop there is at least 2 IP addresses involved and those ms times add up. AWS Dogfish Routing?
'SoS', Ken