新しいAWSインスタンス起動後に発生する504 Gatewayエラー

here is a post you can check that might help you