Shake it
Cometary objects are going very fast relative to Earth- also unless the object was pretty big it also would be difficult to accurately hit one.
As far as vaporizing the surface of the comet by exploding the nuke a few miles away from comet, you would probably need to deliver far more energy per sq meter than what the comet has already recieved from exposure to the Sun. If the comet came as close as say Mercury's orbit it's surface would be exposed to 9350 watts per sq meter- about 7 times more energy than at Earth's distance (1418 watts).
-gb
