nginx php程序 文件上传大小限制

关于 PHP 程序上传限制

更改 php.ini 配置文件

upload_max_filesize = 5M
post_max_size = 16M

通过 nginx 环境限制上传大小:

可以在 httpd { } 模块, server { } 模块,location { } 模块进行设置;

http { } 模块 是控制着所有nginx收到的请求。

server { } 模块,则控制该server收到的请求报文大小,

location { } 模块,只对匹配了location 路由规则的请求生效。

client_max_body_size 5m;
client_body_buffer_size 128k;