nginx cause problems because the authority can not upload large files

1, After using nginx proxy, application upload files and found a small file that can be uploaded, can not upload large files, check nginx logs and found that such a sentence: client intended to send too large body

   Profiles in nginx.conf server plus  client_max_body_size 1024M

  Restart nginx, upload large files, or upload will not work, but there is no backstage client intended to send too large body of the log.

  At this time, such as log Background: 2019/08/02 18:37:35 [Crit] 437 115 # 0: * 34 is Open () "/ usr / local / Nginx / client_body_temp / 0,000,000,009" failed (13 is: the Permission denied). The small file that can be uploaded.

2, again nginx.conf edit files, plus the beginning user root;

#user nobody;
user root;
worker_processes 1;

3, again restart nginx, large files can be uploaded.

4, Problem Analysis: Not careful analysis.

   But think the reason might be before nginx should not add user root, nobody is the default user to run, while using nginx upload files, large files forwarded to the application at first cache in a directory, but nobody user rights too , the file can not be written due. While small files are not cached, forwarded directly to the application. Next time free and then carefully analyze.

Guess you like

Origin www.cnblogs.com/zzw-zyba/p/11290706.html