Copy Rotation constraint rotating on wrong axis with IK bone
The simplest way to have this result, as moonboots says, is to set the foot as child of the IK controller.

If you want to understand how to use rotation constraints you have to activate the axes display in the armature properties, and vary the bones'roll value in edit mode.

Every bone shows its axes on its tip (while it's more convenient to think they are on its head, as a joint).

Y axis it's always longitudinal to the bone.