Nitrite constitutes a significant pollutant that impedes the growth of P. vannamei. Conventional treatments are primarily geared toward decreasing nitrite concentrations from an environmental standpoint. Nevertheless, investigating methodologies to enhance the ability of shrimp to withstand nitrite-induced stresses on an individual basis remains an unexplored topic. The present study examines the impact of autophagy on shrimp’s response to high nitrite environments through rapamycin injection. The research findings indicate that activating autophagy can effectively enhance the survival rate of shrimp under high nitrite conditions. Additionally, total hemocyte count (THC) results in the hemolymph demonstrate that autophagy can alleviate the reduction in blood cell count caused by nitrite stress. The transcriptome results show that up-regulation of 718 genes and down-regulation of 1,071 genes after nitrite stress. Most of the differentially expressed genes (DEGs) after nitrite stress were related to physiological processes, including oxidative stress, energy metabolism, and lysosomes. Compared with nitrite stress, there are 911 up-regulated genes and 713 down-regulated genes activated by autophagy, which are related to immune response, specifically involving glutathione metabolism, drug metabolism-cytochrome P450, and metabolism of xenobiotics by cytochrome P450, lysosomes, autophagy, phagosomes, and MAPK signaling pathways. These pathways can reduce oxidative stress and promote the metabolism of harmful substances in the body, in shrimp, thereby improving their survival rates. These findings provide new insights for research aimed at enhancing nitrite tolerance in shrimp.