Second-order nonlinearity gives rise to many distinctive physical phenomena, e.g., second-harmonic generation, which play an important role in fundamental science and various applications. Lithium niobate, one of the most widely used nonlinear crystals, exhibits strong second-order nonlinear effects and electro-optic properties. However, its moderate refractive index and etching sidewall angle limit its capability in confining light into nanoscales, thereby restricting its application in nanophotonics. Here, we exploit nanocavities formed by second-order circular Bragg gratings, which support resonant anapole modes, to achieve a 42 000-fold enhanced second-harmonic generation in thin-film lithium niobate. The nanocavity exhibits a record-high normalized conversion efficiency of 1.21 × 10-2 cm2/GW under the pump intensity of 1.9 MW/cm2. Besides, we also show s- and p-polarization-independent second-harmonic generation in elliptical Bragg nanocavities. This work could inspire the study of nonlinear optics at the nanoscale on thin-film lithium niobate, as well as other novel photonic platforms.