即使大小= 20M并且我的文件为1.5MB,Laradock Nginx也会抛出413错误实体太大

问题描述

我正在使用laradock部署Laravel应用。

在用两个不同的1.5MB虚拟文件(.docx和.pdf)测试上传部分时,出现以下错误

我已经检查了NginxGet-ItemProperty : Property disableNotificationCenter does not exist at path 文件,它的设置确实为20MB:

Nginx.conf

我已重新加载配置:

...
http {
  server_tokens off;
  sendfile on;
  tcp_nopush on;
  tcp_nodelay on;
  keepalive_timeout 15;
  types_hash_max_size 2048;
  client_max_body_size 20M;
  include /etc/Nginx/mime.types;
  default_type application/octet-stream;
  access_log /dev/stdout;
  error_log /dev/stderr;
  gzip on;
  gzip_disable "msie6";
...

但是仍然抛出错误

413请求实体太大

$ sudo docker exec myapp_Nginx_99 Nginx -t $ sudo docker exec myapp_Nginx_99 Nginx -s reload 文件中,我具有以下内容

PHP.ini

我可以看到最大为2MB,但是我尝试使用1.1MB的PDF文件,但仍然收到错误消息。

此外,我在;;;;;;;;;;;;;;;; ; File Uploads ; ;;;;;;;;;;;;;;;; ; Whether to allow HTTP file uploads. ; http://PHP.net/file-uploads file_uploads = On ; Temporary directory for HTTP uploaded files (will use system default if not ; specified). ; http://PHP.net/upload-tmp-dir ;upload_tmp_dir = ; Maximum allowed size for uploaded files. ; http://PHP.net/upload-max-filesize upload_max_filesize = 2M ; Maximum number of files that can be uploaded via a single request max_file_uploads = 20 目录中发现了一个laravel.ini,这是原始配置:

PHP-fpm

但是,如果我尝试使用836KB文件,则上传成功。看起来最大文件上传为1MB,但我在任何地方都找不到它...

鉴于我已经在使用其他应用程序,因此我正在使用Evert Ramos中的Nginx代理来解析每个域。看来问题出在这里

如果我在此代理容器上执行date.timezone=UTC display_errors=Off log_errors=On ; Maximum amount of memory a script may consume (128MB) ; http://PHP.net/memory-limit memory_limit = 256M ; Maximum allowed size for uploaded files. ; http://PHP.net/upload-max-filesize upload_max_filesize = 20M ; Sets max size of post data allowed. ; http://PHP.net/post-max-size post_max_size = 20M max_execution_time=600 default_socket_timeout=3600 request_terminate_timeout=600 ,则看不到$ Nginx -T

我还想解决什么?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)