Objective: The aim of this study was to identify the potential psychological mechanism of well-being in migrants in Shanghai, China. Methods: A cross-sectional study was conducted in 2018. First, a literature review was conducted to understand the salutogenesis of migrants in China. Then, 2573 random participants were recruited from six workplaces and public places in six districts of Shanghai. The Chinese versions of the Patient Health Questionnaire-9 (PHQ-9), the Personal Wellbeing Index (PWI), and the Sense of Coherence (SOC) Scale were used to evaluate the depression, subjective well-being (SWB), and SOC of migrants. The t-test, ANOVA, and multiple linear regression and structural equation models (SEM) were used to analyze the correlations and paths among generalized resistant resources (GRRs), SOC, PHQ, and SWB. Results: The subjects were aged between 18 and 58 (mean, 28.17; SD, 6.99). SOC showed a positive correlation with SWB (r = 0.46, p < 0.001) and a negative correlation to PHQ (r = –0.53, p < 0.001). After controlling for the demographic characteristics, we found that PHQ, SOC (comprehensibility, manageability, meaningfulness), and GRRs (income ratio, marital status) contributed 33.3% of the variance in SWB, and their linear regression coefficients were: −0.32 (p < 0.001), 0.09 (p < 0.001), 0.09 (p < 0.001), 0.15 (p < 0.001), 0.06 (p < 0.05), and 0.16 (p < 0.05), respectively. These findings not only confirmed the direct association among SOC, PHQ and SWB, but also verified two underlying mechanisms regarding the mediating effect of SOC by using SEM: (1) GRRs (income ratio, marital status) are positively associated with a higher SOC, which further contributes to favorable SWB; and (2) PHQ is negatively associated with poor SWB indirectly via SOC. Conclusion: Migrant workers with low SOC and high PHQ are vulnerable to poor well-being levels. Meanwhile, GRRs (income ratio, marital status) may strengthen the SOC level, and can be regarded as the basis of intervention. Further investigation may be needed to focus on external psychological support factors.