This form of Ampere's law don't have \mu_0 on the right side.
And the way you do it for inside is correct (you integrate along the loop inside that goes around the whole length of the magnet, that is in the plane of the loop created from magnet. Imagine how the standard bar magnet filed lines...