Personally, it feels like 幸福在不远处 tells a person that there is hope, that he can find happiness if he carries on. But 幸福不在远处 implies that you shouldn't look for happiness in faraway places as it can't be found there.
From the structural point of view,
幸福不在远处 is a negative statement: 幸福 + 不 + 在远处, whereas
幸福在不远处 is an affirmative: 幸福 + 在 + 不远处.
不远处 here is one vocabulary item (meaning "nearby") and should not be divided into smaller components.