#反向代理
共 27 篇文章
解决 Nginx 代理 gRPC 报错 grpc-status: 14 (UNAVAILABLE)
分析 Nginx 反向代理 gRPC 报 14 UNAVAILABLE 诱因,详解 grpc_pass 指令与 HTTP/2 全链路配置最佳实践。
解决 Nginx 报错 upstream sent too many headers 502 异常
分析 Nginx 反向代理在后端返回过多响应头时报 too many headers 根因,提供 proxy_headers_hash_max_size 调优方案。
解决 Nginx 报错 504 Gateway Time-out 网关超时
分析 Nginx 反向代理出现 504 Gateway Timeout 的深层根因,详解 proxy_read_timeout 调优与上游服务排查。
nginx-upstream-prematurely-closed-connection-fix
Nginx 作为反向代理访问上游应用时间歇性抛出 502 Bad Gateway,错误日志记录 upstream prematurely closed connection while reading response header。本文深入剖析后端 OOM、HTTP 解析不规范与持久连接超时竞态排查修复方法。
解决 Nginx 报错 upstream sent invalid chunked response 502 错误
分析 Nginx 反向代理在接收后端分块传输编码时报 invalid chunked response 根因,提供 proxy_http_version 与后端连接复用调优方案。
解决 Nginx 报错 upstream sent too big chunk: PHP-FPM 缓冲截断
分析 Nginx 反向代理 PHP-FPM 导出大报文时报 too big chunk 根因,提供 fastcgi_buffers 与 fastcgi_buffer_size 调优方案。
解决 Nginx 报错 upstream timed out 110 Connection timed out
分析 Nginx 反向代理向上游发起 TCP 握手超时报 110 Connection timed out 根因,提供防火墙、安全组与 proxy_connect_timeout 排查方案。
解决 Nginx 报错 504 Gateway Time-out 向上游建立 TCP 连接超时
分析 Nginx 向上游建立 TCP 握手超时诱因,详解 proxy_connect_timeout 调优与内网防火墙排查。
解决 Nginx 报错 upstream sent too big chunk: 代理缓冲区溢出
分析 Nginx 反向代理在读取大体积分块响应时因缓冲区不足报 502 根因,提供 proxy_buffers 与 fastcgi 参数调优步骤。
解决 Nginx 报错 upstream prematurely closed connection 502 异常
分析 Nginx 反向代理在读取响应时后端连接异常断开报 prematurely closed connection 根因,提供后端崩溃排查与超时调优步骤。
解决 Nginx 报错 upstream sent too big chunk in chunked response
分析 Nginx 反向代理在读取分块响应时因单个 chunk 超出内存限制报 502 根因,提供 proxy_buffers 与缓冲区优化方案。
解决 Nginx 报错 upstream sent too big chunk 流式数据截断
分析 Nginx 反向代理在读取后端大型分块流时报 too big chunk 根因,提供 proxy_buffers 与单分块限制优化步骤。
解决 Nginx 报错 proxy_next_upstream 不重试非幂等请求
分析 Nginx 默认不重试 POST/PUT 等非幂等请求导致 502/504 直接透传根因,提供 non_idempotent 与超时安全配置方案。
nginx-websocket-1006-connection-closed-abnormally-fix
前端 WebSocket 频繁断开连接并收到 1006 Abnormal Closure。本文深入剖析 Nginx 协议升级 Upgrade 头丢失、proxy_read_timeout 默认 60 秒超时与心跳保活解决方案。
解决 Nginx 报错 upstream sent no valid HTTP/1.1 response 502
分析 Nginx 代理将 HTTP 请求转发到了 HTTPS/TCP 原始端口报 no valid response 根因,提供协议对齐与 SSL 配置方案。
Nginx 反向代理报 upstream prematurely closed connection:排查 proxy_buffering 限制
Nginx 在代理导出大量数据或大响应报文时,传输随机中断并向客户端抛出 502。分析由于 proxy_buffering 开启但临时文件路径无权限,或后端服务执行崩溃导致连接过早关闭的根因,并给出排查与配置步骤。
Caddy 2.11.6 的 POST 流 60 秒断开
Caddy 2.11.6 代理 HTTP/1.1 非空 POST 流时,请求体 deadline 可能在读完后残留,令持续有心跳的响应约 60 秒中断。2.11.7 已修复。
FastCGI 没有跳转
Caddy 2.11.7 处理缺少 Status 的 FastCGI Location 响应时会返回 200。显式输出 CGI 重定向状态,核对响应入口与后续正式版本边界。
Caddy 配置 versions h2 后报 malformed HTTP response
Caddy反代DoH出现malformed HTTP response时,核对TLS ALPN与versions枚举。修正h2为受支持的2,保留证书验证,区分旧版请求错误与新版加载拒绝。


