系统环境ubuntu
vim /etc/nginx/conf.d/default.conf #打开nginx的配置文件
server {
listen 8081;
listen 8443 ssl;
root /usr/share/nginx/html;
index index.html;
client_max_body_size 200m; 添加此字段后面跟限制文件的大小
server_name localhost;
保存退出并重启nginx
root@web~# nginx -t 检查nginx的配置文件
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
root@web~# /etc/init.d/nginx restart 重启nginx