解决nginx提交文件太大(413 Request Entity Too Large)

user  nginx;
worker_processes  1;

error_log  /var/log/nginx/error.log warn;
pid        /var/run/nginx.pid;


events {
    worker_connections  1024;
}


http {
    include       /etc/nginx/mime.types;
    default_type  application/octet-stream;
    
    # 解决413 Request Entity Too Large,nginx默认限制1m
    client_max_body_size 1024m;

    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';

    access_log  /var/log/nginx/access.log  main;

    sendfile        on;
    #tcp_nopush     on;

    keepalive_timeout  65;

    #gzip  on;

    include /etc/nginx/conf.d/*.conf;
}

主要是这个,默认是1m,设置客户端请求的最大文件大小

client_max_body_size 1024m;
发布了178 篇原创文章 · 获赞 83 · 访问量 85万+

猜你喜欢

转载自blog.csdn.net/fuck487/article/details/103550401
今日推荐