我已经在 Elastic Beanstalk 中部署了一个应用程序,更改了一些配置,以便我可以上传更大的文件并重新启动 nginx 服务器。当我上传一个小于2GB的文件时,上传成功。但是,当我上传超过2GB的文件时,却无法上传成功。以下是我在 /etc/nginx/nginx.conf 文件中添加的行:
client_max_body_size 7500M;
proxy_connect_timeout 1200s;
proxy_send_timeout 1200s;
proxy_read_timeout 1200s;
fastcgi_send_timeout 1200s;
fastcgi_read_timeout 1200s;
另外,我在 .ebextensions 中添加了配置文件并放入以下内容:
files:
"/etc/php.d/99uploadsize.ini":
mode: "000644"
owner: root
group: root
content: |
post_max_size = 5000M
upload_max_filesize = 5000M
memory_limit = 5000M
commands:
remove_old_ini:
command: "rm -f /etc/php.d/99uploadsize.ini.bak"
并尝试了以下内容:
files:
"/etc/nginx/conf.d/proxy.conf":
mode: "000755"
owner: root
group: root
content: |
post_max_size = 7500M
upload_max_filesize = 5000M
memory_limit = 7500M
client_max_body_size = 5000M
这是 phpinfo() 快照:
慕桂英3389331