Can I delete files in nginx client_body_temp directory?

Solution 1:

what is this directory (/usr/local/nginx/client_body_temp/) for?

The directory was used to save buffered temporary file from client request body. Normally the temporary file inside the directory was used to buffer request body that larger than client_body_buffer_size. And normally the file was removed after nginx has finished process the request.

Other use of that directory is to debug client request body. When you set client_body_in_file_only on;, nginx will save the body to those directory. But, in this case nginx won't remove them. You can use client_body_in_file_only clean; for clean the temporal files or disable it with client_body_in_file_only off;

and can I delete these files?

Yes, you can safely remove those files.