3

I am getting 502 Bad Gateway error when I tried to upload larger size file, greater than 500MB. I have added below annotation to my ingress.yaml file, but still it doesn't work. I have deployed nginx with the help of kubernetes.

    nginx.ingress.kubernetes.io/client-max-body-size: 1500m
    nginx.ingress.kubernetes.io/proxy-body-size: 1500m
    nginx.ingress.kubernetes.io/proxy-buffer: 16 32k
    nginx.ingress.kubernetes.io/proxy-buffer-size: 64k
    nginx.ingress.kubernetes.io/proxy-connect-timeout: 60s
    nginx.ingress.kubernetes.io/proxy-read-timeout: 1800s
    nginx.ingress.kubernetes.io/proxy-send-timeout: 1800s

I increased my pod memory and cpu as well to 1 CPU and 2Gi memory but still maximum I could upload is 500MB. My application code is written in nodejs.

SVD
  • 385
  • 4
  • 24
  • whats the max payload size on the nodejs side and timeout? and when/after how many seconds you got 502? – Adiii Aug 05 '22 at 05:14
  • Payload size, I am not sure for it. After like 2-3 mins, once the file upload reaches to 99%, I get's 502 error – SVD Aug 05 '22 at 05:18
  • @Adiii, I got the payload size. payload: { maxBytes: 5e+11, output: 'stream', parse: true, allow: 'multipart/form-data', timeout: 60000, multipart: true, }, – SVD Aug 05 '22 at 05:22
  • which module you are using at nodejs side? – Adiii Aug 05 '22 at 05:54
  • seems like backend module timeout after 60 second – Adiii Aug 05 '22 at 05:55
  • make sure bodyparser or what ever module you are using has same timeout as proxy and also if it server level that make sure it enough to process the request https://stackoverflow.com/questions/21708208/express-js-response-timeout – Adiii Aug 05 '22 at 05:57
  • okay, let me check for it – SVD Aug 05 '22 at 06:22
  • Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/247047/discussion-between-adiii-and-svd). – Adiii Aug 05 '22 at 06:29

0 Answers0