gpt4 book ai didi

google-app-engine - 502 Bad Gateway 错误 - 在从上游读取响应 header 时,上游发送了太大的 header

转载 作者:行者123 更新时间:2023-12-04 17:34:13 27 4
gpt4 key购买 nike

我在 Google App Engine 中使用 wordpress。当我创建一个 POST API 时,得到一个错误:“从上游读取响应头时上游发送了太大的头”。返回 502, Bad Gateway, nginx

我在 POST API 中发送的数据(JSON)大约为 4kb。如果数据发送低于 2kb API 返回成功。

我尝试了 App Engine 标准和灵活环境,但面临同样的问题。

根据此链接:
upstream sent too big header while reading response header from upstream

使用缓冲区修改 nginx-app.config 文件将解决此问题。但它不起作用。

在 App Engine 中,默认的 nginx-app.config 看起来像。

location / {
try_files $uri /index.php?q=$uri&$args;
}

location ~ ^/wp-admin {
try_files $uri $uri/index.php?$args;
}

不确定我需要在哪里添加这些代理缓冲区。

我尝试在默认位置内添加代理缓冲区,如下所示,但没有帮助。
location / {
try_files $uri /index.php?q=$uri&$args;
fastcgi_buffers 16 16k;
fastcgi_buffer_size 32k;
proxy_buffer_size 128k;
proxy_buffers 4 256k;
proxy_busy_buffers_size 256k;
}

请帮我解决这个问题。

最佳答案

这是预期行为,因为 App Engine 的 nginx 配置使用 4K 的默认 proxy_buffer_size。

解决方法是发出累积低于此限制的 HTTP header 。有一个开放的功能要求增加这一点,但似乎不太可能增加到 128K。如果增加到 128K 是您用例的唯一解决方案,我建议使用此 issue tracker 创建一个请求并包括业务影响以说明对该功能的需求。

关于google-app-engine - 502 Bad Gateway 错误 - 在从上游读取响应 header 时,上游发送了太大的 header ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57294212/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com