Glass nanocomposites containing phase-controlled Cu-Ni nanostructures were prepared. The optical nonlinearities of the as-obtained glasses were evaluated. The work provides feasible pathway to acquire new nonlinear optical materials. The mechanism on optical nonlinearities was proposed.