We study the linear and nonlinear optical properties of wurtzite GaN under c-axial stress field, using density functional theory calculations. The fully structural optimization at each c-axial strain was performed. The calculated dielectric functions show that tensile c-axial strain effectively improves the linear optical efficiency, especially for the band-edge transitions, and significantly increase the mobility of electrons in the conduction band. Second-order nonlinear optical susceptibilities show that the tensile c-axial strain will enhance the zero- and low-frequency nonlinear responses of GaN. The enhancement of the nonlinear optical property is explained by the reduction of the polarization of wurtzite GaN under tensile c-axial strains. Based on these findings, we propose a method for improving the electrical and optical properties of the crystal through imposing appropriate stress on the high symmetry crystalline directions.