The invention discloses a composite nanofiltration membrane, a preparation method thereof, and application of the composite nanofiltration membrane prepared by adopting the preparation method to the field of water treatment. The composite nanofiltration membrane comprises a supporting layer and a separating layer which are overlapped together, wherein the separating layer is a cross-linked net structure which is positioned on the surface of the supporting layer and formed through thermal crosslinking reaction of polymer containing hydroxyl and a silane coupling agent with a structure as shown in the formula (I) (shown in the description) through sol-gel; in the formula (I), Y is alkenyl or carbon functional group, the carbon functional group is alkyl carried with Cl, NH2, epoxy, SH, N3, (methyl) acrylyl or isocyanate group; X is one or more of Cl, OMe, OEt, OC2H4OCH3, OSiMe3 and OAc. According to the composite nanofiltration membrane and the preparation method thereof, provided by the invention, stable operation of the composite nanofiltration membrane in an aqueous solution with the PH of 0-14 is achieved, a higher salt removing rate and water permeability are achieved, higher acid and alkali resistance is further achieved; besides, the method is simple, and an industrial application prospect is further realized.