Improving the subjective well-being of farmers is the goal of rural revitalization. Based on the data from a survey of 956 farmers from 44 villages in six nature reserves in Liaoning province and the least squares regression model, this paper studies the impact of ecological environment quality on the subjective well-being of farmers around nature reserves and analyzes the mediating role of environmental cognition in the impact of ecological environment quality on the well-being of farmers around nature reserves. The results show that in terms of ecological environment quality, both the natural environment and the social environment have a significant positive impact on the subjective well-being of farmers around nature reserves. For every 1% improvement in the following aspects, the subjective well-being of rural households increases as follows: air quality: 25%, soil and vegetation conditions: 46%, wildlife population: 27%, medical service facilities: 23%, basic living facilities: 30%, environmental beautification facilities: 33%. Environmental cognition plays a mediating role between ecological environment quality and farmers' subjective well-being. The influence of the natural environment and social environment on the subjective well-being of farmers outside nature reserves is higher than that inside nature reserves. This paper enriches the research on subjective well-being to a certain extent, analyzes the mechanism of the ecological environment's influence on farmers' subjective well-being, and provides theoretical reference for further improving farmers' subjective well-being and promoting ecological civilization construction.