nginx 修改文件上传大小限制
程序员文章站
2022-04-28 19:12:46
修改nginx的配置文件,添加client_max_body_size 字段 注:client_max_body_size 必须要放在server下的server_name下,而不是放在location字段下面 ......
修改nginx的配置文件,添加client_max_body_size 字段
注:client_max_body_size 必须要放在server下的server_name下,而不是放在location字段下面
server {
listen 80;
server_name www.abc.com;
add_header access-control-allow-origin *;
add_header access-control-allow-credentials true;
add_header access-control-allow-headers *;
add_header access-control-allow-methods get,post,options;
client_max_body_size 10m;
location / {
proxy_set_header host $host;
proxy_set_header x-real-ip $remote_addr;
proxy_set_header x-request-id $global_request_id;
proxy_set_header x-forwarded-proto $scheme;
proxy_set_header x-forwarded-for $proxy_add_x_forwarded_for;
proxy_ignore_headers x-accel-expires expires cache-control set-cookie;
proxy_pass http://192.168.1.1:8080;
}
}