[英]Only POST API giving 502 badgatway => recv() failed (104: Connection reset by peer) while reading response header from upstream
I am running Django with Gunicorn + Nginx(Kubernetes, ingress).我正在使用 Gunicorn + Nginx(Kubernetes,入口)运行 Django。
I have discovered that a particular POST request we make has a long response string.我发现我们发出的特定 POST 请求有一个很长的响应字符串。 Trying to debug, it seems that Nginx is not accepting this response string based on the length - I can pass short response strings but the same issue.
尝试调试时,Nginx 似乎不接受基于长度的响应字符串 - 我可以传递短响应字符串,但同样的问题。
I have the same API with GET and POST.我有与 GET 和 POST 相同的 API。 but get API with 1000 request no issue but post API with 300 requests some of the random request API's are giving 502 bad gateway.
但是获得带有 1000 个请求的 API 没有问题,但是发布带有 300 个请求的 API 一些随机请求 API 给出了 502 错误网关。 For more info please refer attached screenshot
有关更多信息,请参阅随附的屏幕截图
I couldn't find anything about this on the Nginx and Gunicorn site or via google searching.我在 Nginx 和 Gunicorn 网站上或通过谷歌搜索找不到任何关于此的信息。 Does anyone know what could be the issue?
有谁知道可能是什么问题?
Try with ingress annotation to timeout changes here what i am using so far not facing any issue在这里尝试使用入口注释来超时更改我目前使用的没有遇到任何问题
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
annotations:
cert-manager.io/cluster-issuer: dev
kubernetes.io/ingress.class: nginx
nginx.ingress.kubernetes.io/configuration-snippet: |
if ($request_uri ~* \.(js|css|gif|jpe?g|png)) {
expires 1M;
add_header Cache-Control "public";
}
nginx.ingress.kubernetes.io/proxy-body-size: 50m
nginx.ingress.kubernetes.io/proxy-read-timeout: "2000"
nginx.ingress.kubernetes.io/proxy-send-timeout: "2000"
nginx.ingress.kubernetes.io/rewrite-target: /
name: test-ingress
namespace: default
spec:
rules:
- host: example.com
http:
paths:
- backend:
serviceName: service-name
servicePort: 80
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.