今天遇到413这个坑,翻了半天的网页,终于解决。
要解决上传大文件,遭遇 413 Request Entity Too Large 错误这个问题,因为我服务器配置是Nginx+PHP+IIS7.5,所以需要分别修改 Nginx、Php、IIS的相关配置。
以下按上传500M的文件的需求来进行修改。
1.修改Nginx配置文件
这点估计但凡做了一点搜索尝试的同学都知道了,具体来说
打开 nginx\conf\nginx.conf 这个文件
添加一行 client_max_body_size ,将其数值加大
需注意,若你有加 client_header_buffer_size 这个设置,那么
client_max_body_size 须 > client_header_buffer_size 的值
http {
include mime.types;
default_type application/octet-stream;
server_names_hash_bucket_size 64;
#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 logs/access.log main;
client_heade