The early universe before cosmic inflation, was nothing but high energy sub atomic particles. Cosmic inflation kicked in, and dispersed that matter and energy. Cosmic background radiation is the remnants of that process. It comes from all directions in the universe, because it predates inflation.
Which is to say, your question can’t be answered, because cosmic background radiation exists only because of inflation. It was created before inflation kicked in, as part of a singularity, with no spatial dimensions. As a result, today, it’s everywhere, all the time, from all directions. It wasn’t far away when it was created, because far away didn’t have any meaning in a singularity without spatial dimensions.
It’s roughly evenly distributed throughout the universe. So if you imagine the universe Big Banged into existence at the current size, no expansion, it would be emitted in all parts of space, out of the primordial energy soup, before condensing into matter.
But that doesn’t really make sense because if you increase the volume you decrease the density, therefore you wouldn’t have the big bang or any background radiation at all.
But to strictly answer your question, if you picked any one CMB photon you received right now, that photon would probably have been from the edge of the visible universe, ~46.5 billion light years away. The distance would probably be slightly less because our theoretical static universe would not have expanded in the intervening time.