- We report on the nonlinear tunneling effects of spatial solitons of the generalized nonlinear Schrdinger equation with distributed coefficients in an external harmonic potential. By using the homogeneous balance principle and the F-expansion technique we find the spatial bright and dark soliton solutions. We then display tunneling effects of such solutions occurring under special conditions; specifically when the spatial solitons pass unchanged through the potential barriers and wells affected by special choices of the diffraction and/or the nonlinearity coefficients. Our results show that the solitons display tunneling effects not only when passing through the nonlinear potential barriers or wells but also when passing through the diffractive barriers or wells. During tunneling the solitons may also undergo a controllable compression.