Under the gob-side entry retaining mining mode with roof cutting and pressure relief (GERRC), the gob and retained roadway section are interconnected to create an open area. Owing to the increased airflow, the coal remnants in the gob are more prone to spontaneous combustion. This study aimed to investigate the distribution of oxygen concentration within a gob and identify optimal parameters for nitrogen injection. The engineering context was the "110 method" introduced in the 1201 working face of the South Five mining area at Daxing. Computational fluid dynamics simulation software was used to analyze the effects of various nitrogen injection treatment parameters on the overall performance of the gob, including their impact on oxygen distribution. The simulation results showed that air leakage within the gob primarily originates from the working face adjacent to the intake roadway, as well as gaps within the retained roadway. The increased air leakage causes the high O 2 concentration range in the gob to expand, and the retained roadway section is connected to an area with a high concentration of oxygen near the working face, which increases the risk of residual coal spontaneous combustion. The results show that the optimal nitrogen injection conditions for inerting and reducing the risk of spontaneous combustion within the gob require an injection quantity of 500 m 3 /h, with the injection point located at a depth of 60 m. With these parameters, the range of the oxidation zone was significantly reduced. To monitor the O 2 concentration and temperature change curves in the gob during the project implementation, a bundle tube monitoring system was used, considering the actual mining situation. By varying the nitrogen injection spacing and quantity, we found that injecting nitrogen at a spacing of 30 m and at a quantity of 500 m 3 /h effectively placed most areas of the gob in the suffocation zone, reducing the risk of spontaneous combustion of residual coal. The accuracy of the simulation was verified. The study offers valuable insights into improving safety in coal mines and reducing spontaneous combustion incidents, providing important reference significance for fire prevention and control.