nginx上传错误413 Request Entity Too Large

  • A+
所属分类:Nginx

默认情况下使用nginx反向代理上传超过2MB的文件,会报错413 Request Entity Too Large,解决这个方法很简单,修改配置client_max_body_size值即可

修改nginx.conf

如果需要上传更大的文件,那么client_max_body_size改成更大的值即可,这边改成了10MB

重启nginx

weinxin
微信公众号
扫一扫关注运维生存时间公众号,获取最新技术文章~

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

目前评论:4   其中:访客  4   博主  0

    • Aceslup 9

      memory_limit 不需要设置吧?

      • 牧童Damian 9

        mark

        • 默北 默北 6

          还需要修改php上传文件大小限制
          ;This sets the maximum amount of memory in bytes that a script is allowed to allocate
          memory_limit = 32M
          ;The maximum size of an uploaded file.
          upload_max_filesize = 20M
          ;Sets max size of post data allowed. This setting also affects file upload. To upload large files, this value must be larger than upload_max_filesize
          post_max_size = 10M