Identifying modifiable factors in primary prevention strategies is a typical goal of glioma epidemiology. Among many glioma risk factors, diet was always considered as one. Most of the relevant studies thus far were concentrated on the West. It was crucial to investigate the connection between the Chinese diet and gliomas given the stark variations between western and eastern diets. A food frequency questionnaire including 114 items was used to investigate the food intake of the study subjects. The Chinese Dietary Quality Index (CDQI), the Chinese Dietary Balance Index (CDBI), the Dietary Antioxidant Index (DAI), the Dietary Inflammation Index (DII), and the Chinese Healthy Eating Index (CHEI) were calculated based on the data provided by the food frequency questionnaire to evaluate dietary quality, dietary balance, dietary antioxidants, dietary inflammation and adherence to the Chinese dietary guidelines in 506 glioma patients and 506 controls, respectively. After adjusting covariates, CHEI (OR = 0.90, 95% CI: 0.88–0.93) and DAI (OR = 0.61, 95% CI: 0.54–0.70) were correlated to a reduced glioma risk, and CDBI-based undernutrition (OR = 1.08, 95% CI: 1.06–1.12) and overnutrition (OR = 1.14, 95% CI: 1.09–1.20) and DII (OR = 2.20, 95% CI: 1.81–2.68) were correlated to an elevated glioma risk. Moreover, restrictive cubic spline analysis showed that there were significant nonlinear dose–response relationships between CHEI, CDBI, DAI, DII, and glioma. Therefore, adhering to the Chinese dietary guidelines was connected with a lower glioma risk, and undernutrition and overnutrition in the Chinese diet were associated with an increased risk of glioma.