修改nginx上傳文件大小配置

修改nginx上傳文件大小配置

根據(jù)官方文檔說(shuō)明,可以在nginx配置文件中http、server、location等配置塊添加配置,client_max_body_size size;來(lái)調(diào)整允許的客戶(hù)端上傳文件的body大小。設(shè)置為0,表示不限制。

(推薦教程:nginx使用教程

nginx默認(rèn)的客戶(hù)端body大小為1M。

具體配置如下:

http?{ ????log_format??main??'$remote_addr?-?$remote_user?[$time_local]?"$request"?' ??????????????????????'$status?$body_bytes_sent?"$http_referer"?' ??????????????????????'"$http_user_agent"?"$http_x_forwarded_for"';  ????access_log??/var/log/nginx/access.log??main;  ????sendfile????????????on; ????tcp_nopush??????????on; ????tcp_nodelay?????????on; ????keepalive_timeout???65; ????types_hash_max_size?2048; 	 ????client_max_body_size?100m; 	.... 	}

以上就是修改

? 版權(quán)聲明
THE END
喜歡就支持一下吧
點(diǎn)贊13 分享
站長(zhǎng)的頭像-小浪學(xué)習(xí)網(wǎng)月度會(huì)員