Topology-Controlled Nonreciprocal Photon Scattering in a Waveguide