This regex will only match request urls containing a count parameter. It might have to be /nearest/?((\d+))?/? to catch all of:
/nearest, /nearest/, /nearest/<count> and /nearest/<count>/