本文主要和大家分享nginx如何修改上传文件大小,自己搭的服务器,用nginx做代理。上传超过1M大的客户端文件无法正常上传,nginx直接报错,上传文件太大,于是修改了下nginx的配置,就可以了。
按照网上所说的加上client_max_body_size 字段,怎么重启nginx都不行。后来发现放的位置有问题!
server {
listen 80;
server_name localhost;
client_max_body_size 10M;
location /web { alias D:/web;
index main.html;
}
location /web/service {
proxy_pass http://192.168.1.188:8080/service;
}
location /web/service/upload {
proxy_pass http://192.168.1.188/upload;
}
}client_max_body_size 10M 必须要放在server下的server_name下,而不是放在localhost /web的大括号里
自己搭的服务器,用nginx做代理。上传超过1M大的客户端文件无法正常上传,nginx直接报错,上传文件太大,于是修改了下nginx的配置,就可以了。
按照网上所说的加上client_max_body_size 字段,怎么重启nginx都不行。后来发现放的位置有问题!
server {
listen 80;
server_name localhost;
client_max_body_size 10M;
location /web { alias D:/web;
index main.html;
}
location /web/service {
proxy_pass http://192.168.1.188:8080/service;
}
location /web/service/upload {
proxy_pass http://192.168.1.188/upload;
}
}client_max_body_size 10M 必须要放在server下的server_name下,而不是放在localhost /web的大括号里。
相关推荐:
模板采用响应式设计,自动适应手机,电脑及平板显示;满足单一店铺外卖需求。功能:1.菜单分类管理2.菜品管理:菜品增加,删除,修改3.订单管理4.友情链接管理5.数据库备份6.文章模块:如:促销活动,帮助中心7.单页模块:如:企业信息,关于我们更强大的功能在开发中……安装方法:上传到网站根目录,运行http://www.***.com/install 自动









