Nginx 默认限制请求附件大小为 1MB。即:默认当你通过 Nginx 代理上传附件,大于 1M 的文件时,浏览器会抛出异常。 可以通过设置 nginx.conf 中的 http 块,添加或修改 client_max_body_size 参数来更改默认的附件大小限制。例如,将 client_max_body_size 设置为 8m,即可将附件大小限制更改为 8MB。这将影响到所有站点。当然也可以只修改某一个站点的配置,在站点的 server 块中添加或修改 client_max_body_size 即可。 修改后检查配置文件的语法是否正确:sudo nginx -t。如果没有显示语法错误,继续下一步;如果有错误,请检查配置文件并修复错误。 然后重新加载 Nginx 配置:sudo service nginx reload 或者 sudo systemctl reload ngi...
包含 nginx 标签的文章
Ubuntu 安装 Nginx
apt-get install nginx # 安装 service nginx status # 查看服务运行状态 netstat -nap |grep nginx # 查看服务所使用的端口 网页浏览器访问服务器 IP 显示: Welcome to nginx! If you see this page, the nginx web server is successfully installed and working. Further configuration is required. For online documentation and support please refer to nginx.org. Commercial support is available at nginx.com. Thank you for using nginx...