### [Nginx 反代 + SSL 配置后接口一直 502,求助大佬](https://8maoku.com/topic/2353) **Published:** 2026-08-26T13:15:24 **Author:** 低调码农 **Excerpt:** 服务器换了之后,Nginx 反代后端 API 一直 502 Bad Gateway,本地 curl 后端是通的… ![Nginx反代502排查图](https://www.q0di.top/wp-content/uploads/2026/08/nginx_502-1.png) 服务器换了之后,Nginx 反代后端 API 一直 502 Bad Gateway,本地 curl 后端是通的,求指点。 相关配置片段: location /api/ { proxy\_pass http://127.0.0.1:8080/; proxy\_set\_header Host $host; proxy\_set\_header X-Real-IP $remote\_addr; } 已排查:后端端口监听正常、防火墙放行、SSL 证书也生效了(静态页能开)。**是不是 upstream 或者 proxy\_pass 尾巴的斜杠问题?**有没有遇到过的大哥帮忙看看,感激不尽! **Comments:** **maoku:** 502 多半是 upstream 超时或 PHP-FPM 挂了,先看 error.log 里 upstream 那行。 **maoku:** 把 fastcgi\_read\_timeout 调大再重启试试,我们之前也是这么解决的。 ---