502 on large multipart form-data request

We are experiencing a 502 Bad Gateway response on our API, the request does not seem to arrive to the django server as there is no log of an error nor 502 request, I had guess Qovery(or Kubernetes) run nginx under the hood to reverse-proxy the request from the domain to the specified port on the app, normally i have seen this kind of error happening due to a misconfiguration on the nginx side where either the nginx server is not configured to receive large requests or it just timesout due to its configuration.

I have tried with a large payload ~50MB and a small one ~10MB and the small one goes thru but the large one does not. Theres a time difference ofc between the two. I would guess it is a timeout error as normally if the payload is too large the response should be a rejection(400-499 response) not a server error(500-599) Just made some tests takin time into account and time is varying a lot so seems like it is not the timeout request config but the size one (?) im really not sure which one it is here as i cant access the log for the Nginx instance

Any idea how we can bypass this? Is qovery or kubernetes running an nginx instance under-the-hood? Or could it be related to the previous issue we are having with our cluster not being able to sustain the load?

In case it is nginx: If we setup our own Nginx service running on top of the entire environment will it enable us to bypass the qovery/kubernetes one or will it still have the same configuration issue?

more context: we have run this config for more than a month now and we have been regularly testing every week is weird that now we are experimenting this issue

Hi @ditorojuan ,

If you want to make some custom config on your Nginx configuration for your application, please take a look here, you should find what you’re looking for: Advanced Settings | Docs | Qovery


1 Like

Turns out the error was a misconfiguration. The connection with the Gunicorn server was being dropped due to a timeout on gunicorn side, had to make an nginx server in front of the environment app for it and then just checking the nginx logs was enough to see the problem was on the django side!

Thanks @Pierre_Mavro will keep that in mind when we have problems related to the size! In this case I was wrong and just did not have enough observability

1 Like