1. Given the function $f(x)=|x+1|+|a x+1|$ has a minimum value of $\frac{3}{2}$. Then the value of the real number $a$ is $\qquad$ .
1. $-\frac{1}{2}$ or -2.
When $|a| \leqslant 1$, $f(-1)=\frac{3}{2}$, we get
$$
a=-\frac{1}{2} ;
$$

When $|a|>1$, $f\left(-\frac{1}{a}\right)=\frac{3}{2}$, we get $a=-2$.
Therefore, $a=-\frac{1}{2}$ or -2.