I've got a problem with my wordpress site that means I get a 502 bad gateway error. The site is hosted on AWS (EC2 instance).
I migrated the site to a google cloud instance to test if that would work and the site and the site works there so assume it is an AWS specific problem with my configuration.
So far I have created a new instance and migrated the (working) site from google to there (using All in one migrate plugin), checked the .htaccess file is not corrupt (and resaved it with the correct info just to make sure) and changed plugins folder to plugins_old to see if turning these off made a difference (it didn't).
If I test the site on downforeveryoneorjustme.com it says the site is up and it's just me.
On pingdom's dns check it says everything is fine. On webpagetest.com it says there is a 524 error.
Prior to migrating the wordpress site across I installed wordpress from scratch and everything was working fine on the test page so I think the issues lies somewhere within the wordpress settings.
Please advise on what configuration files I might need to change to get the site working on my EC2 instance given that it does work on Google Cloud as I'm at a loss as to what to try next (and I want to stay on AWS rather than a permanent move to Google!).