BackgroundEnvironmental pollution seriously endangers people’s physical and mental health, especially the health of middle-aged and elderly people. Environmental pollution, trade openness, and population health are interconnected. Environmental pollution may have a nonlinear impact on health, and the impact of trade openness on the health effects of environmental pollution may not be a simple strengthening or weakening effect. However, few studies have used threshold effects model to explore the nonlinear mechanisms of environmental pollution’s impact on health in China. As a result, this study incorporates trade openness into the research framework on the health effects of environmental pollution, aiming to study the mechanism of environmental pollution on health.MethodsUsing the China Health and Retirement Longitudinal Study (CHARLS) data from 2013 to 2020 and the data of 111 prefecture-level cities in China, we combine two-way fixed-effects models and threshold models to explore the effects of environmental pollution on the health of middle-aged and elderly people and the role of trade openness in the path of environmental pollution affecting health.ResultsEnvironmental pollution impairs the health of middle-aged and elderly people, and there is a single threshold effect and regional heterogeneity in this negative impact. Trade openness has the effect of first weakening and then strengthening in the inhibitory effect of environmental pollution on health.ConclusionThe negative impact of environmental pollution on health has regional heterogeneity, and there is a nonlinear relationship between environmental pollution and the health of middle-aged and elderly people. The health effect of environmental pollution is mainly long-term effect, and trade openness has a threshold effect on the impact of environmental pollution on health. Therefore, instead of adopting a one-size-fits-all policy, environmental and economic policies should be customized according to the degree of environmental pollution, trade openness, and regional variations, so as to safeguard the health of middle-aged and elderly individuals through effective environmental governance.