I believe the two portals in the overworld have to be under 128 blocks apart total and also should be at least 8 blocks apart horizontally. I just used some simple 3D coodinate math and built the one in the nether at the midpoint.