nginx upload file

  1. 检查nginx使用的用户和和权限

nginx.conf : user www-data

user www-data;
worker_processes auto;
pid /run/nginx.pid;
include /etc/nginx/modules-enabled/*.conf;

2. create a temp dir for nginx uplodad file cache

mkdir /tmp/nginx
chown -R www-data:www-data /temp/nginx

3. mdf the server config

server
{
        listen 127.0.0.1:443;
        server_name storage.intbird.net;
        index index.html index.htm index.php default.php default.htm default.html;

        client_body_buffer_size 16k;
        client_body_temp_path /tmp/nginx;
        client_max_body_size 512m;

        location / {
            ...
        }
}