The Nexus is a travelling energy ribbon
The Nexus is not stationary. It is a travelling "energy ribbon". It reappears every "39.1 years" in our galaxy (according to Data in the film) and there is no reason for it to appear in the same spot twice.
Presumably, when it appeared 3 light years away from Earth, that was the first time it had appeared there. There is no reason why Starfleet scientists should have known about the Nexus already.
Dr. Tolian Soran, who was exposed to the Nexus during that incident and subsequently became obsessed with it, had learnt enough about it to be able to chart its course and knew with enough precision when and where it would appear next — in the Veridian system, outside Veridian III (nowhere near Earth).
Finally, the fact that the Enterprise-B was the only starship in range of the Nexus is unremarkable. Starfleet's primary mission is exploration and, at any given time outside of war time, most of the fleet is committed to deep space. Earth would mostly be serviced by cargo ships, passenger transports (e.g. to the lunar and Martian colonies and to Jupiter Station), and fixed-position defence infrastructure.