How can I animate a centipede?

I’m currently working on a Centipede-like boss for an RPG featuring many segments on its body with two legs per each of these segments. However, I’m trying to figure out how to set up the centipede to move like a real insect would: having its head walk where it wants to and its body follow along behind it. In other words, if I want the centipede to turn around as it’s following the player, I need its head to start moving around its body and head in the direction that way, rather than allowing the character to set its body rotation to 180 degrees all at once, as this does not look good.

I’ve attached a rough illustration of what I’m talking about if needed. Please let me know if you can think of how to make this skeleton setup work, or if you have a different setup to suggest altogether, and how I can get the segments behind the insect’s head to follow it.

id like to know too, we need more people sharing.

firs thing that come to mind would be something locomotion or and bones, so bones turn toward player with constraint and many bones together look natural, then i can think of other methods with just animation of it turning or playing a turn animation, there is aprocedular method, but i hate procedural stuff so hand made is always better