【发布时间】:2020-02-04 18:32:43
【问题描述】:
我试图将 MP4 文件上传到 Wordpress 媒体,但 413 错误停止了我。我生命的极限(在这个不朽的 bug 中)是 100mb,更多的是指向一个漂亮的 HTTP 错误。
我的环境在一个数字海洋水滴中拥有所有最新版本(PHP、NGINX、Ubuntu、FPM 和 FastCGI)。
我的 confs 包含:
php.ini (FPM and CLI)
file_uploads = On
upload_max_filesize = 700M
max_file_uploads = 20
post_max_size = 710M
max_execution_time = 3000
max_input_time = 6000
memory_limit = 700M
nginx.conf and "site".conf (http, server and location contex)
fastcgi_buffers 8 16k;
fastcgi_buffer_size 32k;
gzip on;
gzip_disable "msie6";
gzip_vary on;
gzip_proxied any;
gzip_comp_level 6;
gzip_buffers 16 8k;
gzip_http_version 1.1;
gzip_min_length 256;
gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript application/vnd.ms-fontobject application/x-font-ttf font/opentype image/svg+xml image/x-icon image/jpeg image/png image/jpg;
server_tokens off;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 5000;
types_hash_max_size 2048;
client_max_body_size 700M;
我尝试将其添加到 NGINX:
client_body_timeout 300;
client_header_timeout 300;
send_timeout 300;
不工作。
在我所有的搜索之后,错误仍然存在,我不会看到退出这个错误。
拜托,有人帮帮我吗?
【问题讨论】:
-
“注意:对于非常大的文件,您可能需要更改 client_body_timeout 参数的值。默认为 60 秒。” (easyengine.io/tutorials/php/increase-file-upload-size-limit)
-
感谢@04FS 的回复。请看我的编辑。这不起作用(我在发布之前尝试过)。
-
你检查过错误日志的内容吗?
-
尝试client_body_timeout 3600; client_header_timeout 3600;发送超时 3600;也别忘了重启php-fpm和nginx
-
你使用 cloudflare 吗? Cloudflare 或其他服务提供商使用某种上传限制!
标签: php wordpress nginx server