Where does the NGINX ingress controller stores temporary files?
This is the message I receive and I am pretty sure it is storing the file on a volume attached to one of my pods:
2021/09/27 20:33:23 [warn] 33#33: *26 a client request body is buffered to a temporary file /var/cache/nginx/client_temp/0000000002, client: 10.42.1.0, server: _, request: "POST /api/adm/os/image HTTP/1.1", host: "vzredfish.cic.shidevops.com", referrer: "https://vzredfish.cic.shidevops.com/setting"
But when I go into the location /var/cache/nginx/client_temp
there is nothing.
I checked on the ingress controller pods too and there is another there either.
I would like to know how to troubleshoot the issue we have. I’m trying to upload a file directly to the pod memory but instead it uploads it to a temporary location first.
Thanks for the help.
Danilo
2
Answers
I want to thank Jakub Siemaszko for the pointer, that was partially the solution.
Our app is deployed in a k8s cluster, we have an nginx controller and an nginx instance in one of the pods. The issue I was having was related to the nginx in the pod and not the controller (I was changing directives and keys in the controller)
In the nginx inside of the pod i had to change the nginx.conf and add the following to both HTTP and location
This fixed the 504 errors (I still see 499 but it is able to complete the upload of the large files).
As for the location of the temp file, that is still a mystery but it's something we don't need to monitor anymore
Answering your question indirectly there seems to some ways to skip proxy buffering to achieve your goal of uploading a file directly to the pod memory, I’ve found an interesting article here, have a look at the Disable proxy buffering section.