Error 504 Gateway después de lanzar una nueva instancia de AWS

here is a post you can check that might help you