We consider the problem of essential self-adjointness of the drift-diffusion operator $H=-\frac{1}{\rho}\nabla\cdot\rho D\nabla+V$ on domains $\Omega\subset\mathbb R^d$. We give criteria showing how the behavior as $x\to\partial\Omega$ of the coefficients $\rho$, $D$ and the potential $V$ balances to ensure essential self-adjointness of $H$, which in turn is closely connected to confinement of quantum particles to $\Omega$. In the process, we will discuss an essential tool, which are new anisotropic Hardy inequalities.