Theory of nonlinear Sagnac effect