<p>I am running Django with Gunicorn + Nginx(Kubernetes, ingress).</p>
<p>I have discovered that a particular POST request we make has a long response string. 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.</p>
<p>I have the same API with GET and POST. 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. For more info please refer attached screenshot<a href="https://i.stack.imgur.com/jMHs4.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/jMHs4.png" alt="enter image description here" /></a></p>
<p>I couldn't find anything about this on the Nginx and Gunicorn site or via google searching. Does anyone know what could be the issue?</p>

jayaprakash k
<p>Try with ingress annotation to timeout changes here what i am using so far not facing any issue</p>
<pre><code>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 &quot;public&quot;;
      }
    nginx.ingress.kubernetes.io/proxy-body-size: 50m
    nginx.ingress.kubernetes.io/proxy-read-timeout: &quot;2000&quot;
    nginx.ingress.kubernetes.io/proxy-send-timeout: &quot;2000&quot;
    nginx.ingress.kubernetes.io/rewrite-target: /
  name: test-ingress
  namespace: default
spec:
  rules:
  - host: example.com
    http:
      paths:
      - backend:
          serviceName: service-name
          servicePort: 80
</code></pre>
