But it is, why do you think it is not?
Let us define unprimed system of reference as the rest system of outside observer and the primed system of reference as the rest system of Object 1.
Since motion is colinear, the only coordinates we need to care about are time ($t$ in unprimed system or $t´$ in primed system) and coordinate $x$ or $x´$.
The velocity in unprimed system is defined:
$$v=\frac{d x}{dt}$$
And in primed:
$$v'=\frac{dx'}{dt'}$$
Now, primed system is boosted along the x coordinate with velocity $v_1$, so the relation of primed and unprimed coordinates is given by lorentz boost:
$$t´=\gamma\left(t-\frac{v_1 x}{c^2}\right)$$
$$x´=\gamma\left(x-v_1 t\right)$$
thus:
$$dt´=\gamma\left(dt-\frac{v_1 dx}{c^2}\right)$$
$$dx´=\gamma\left(dx-v_1 dt\right)$$
And so:
$$v'=\frac{dx'}{dt'}=\frac{dx-v_1 dt}{dt-\frac{v_1 dx}{c^2}}=\frac{\frac{d x}{dt}-v_1 }{1-\frac{v_1}{c^2}\frac{d x}{dt}}$$
$dx/dt$ is x-component of velocity in unprimed system of object in question which will have x'-component of velocity in primed system given by the above formula. For object 2 this gives:
$$v'_{2from1}=\frac{v_2-v_1 }{1-\frac{v_1 v_2}{c^2}}$$
where $v_2$ and $v'_{2from1}$ are x,x´-components of velocity of object 2 in the two frames, not its speed. So depending on the direction they can be possitive or negative.
In the first case when objects are moving against each other substituing speeds for components of velocity (i.e. taking absolute value)gives:
$$\left|v'_{2from1}\right|=\left|\frac{-\left|v_2\right|-v_1 }{1+\frac{v_1 \left|v_2\right|}{c^2}}\right|=\frac{\left|v_2\right|+v_1 }{1+\frac{v_1 \left|v_2\right|}{c^2}}$$
just as you wrote.
For the same direction you get:
$$\left|v'_{2from1}\right|=\left|\frac{\left|v_2\right|-v_1 }{1-\frac{v_1 \left|v_2\right|}{c^2}}\right|$$
if $v_1>\left|v_2\right|$ we get:
$$\left|v'_{2from1}\right|=\frac{v_1-\left|v_2\right|}{1-\frac{v_1 \left|v_2\right|}{c^2}}$$
so your formula is again correct.
Mind you, that it is also independent on the actual position of Object 2, so i am not sure why you think you need to assume that Object 2 is further out from the observer. Also mind you, that in the derivation i assumed that observer, object1, object2 and their motion are all colinear. But the formula works even if observer is not colinear with motion of object1 and object2, because the speed is invariant under trasnlation and you can add one step to translate observers system to colinear one.