One of the comments in the thread links to a useful writeup for the AWS side:
https://www.knowmatic.app/how-to-migrate-aws-ec2-instance-fr...
I didn't find such great docs on the Cloudflare part, but some of these were useful:
https://www.reddit.com/r/selfhosted/comments/14d16lt/if_i_on...
https://community.cloudflare.com/t/the-page-isn-t-redirectin...
https://stackoverflow.com/questions/4616521/nginx-configurat...
https://developers.cloudflare.com/support/troubleshooting/cl...
I'm sure that many HNers would appreciate the information here, but if you prefer my Gmail username is the same as my HN username. Thank you!