您好,欢迎来到 256s

nginx返回413 Request Entity Too Large

admin 2023-06-17 次浏览 0
413 Request Entity Too Large说明php上传文件或者Post内容大小超出限制修改php配置 upload_max_filesize, post_max_size, 怕超时的话还需要修改max_execution_time修改nginx配置 cl...

413 Request Entity Too Large说明php上传文件或者Post内容大小超出限制

  1. 修改php配置 upload_max_filesizepost_max_size, 怕超时的话还需要修改max_execution_time

  2. 修改nginx配置 client_max_body_size(默认1M);

demo:

php.ini

upload_max_filesize = 8Mpost_max_size = 8M

nginx.conf

server {
    server_name xxx.com;    listen 80;    index index.html index.htm index.php;
    root your_web_root;
    client_max_body_size 8M;
    location / {
        try_files $uri $uri/ /index.php?$query_string;
    }
    location ~ \.php$ {
        fastcgi_pass 127.0.0.1:9000;
        include fastcgi.conf;
    }
}