首頁  >  文章  >  運維  >  修改nginx上傳檔案大小配置

修改nginx上傳檔案大小配置

王林
王林轉載
2020-07-17 17:50:246892瀏覽

修改nginx上傳檔案大小配置

根據官方文件說明,可以在nginx設定檔中http、server、location等設定區塊新增配置,client_max_body_size size;來調整允許的客戶端上傳檔案的body大小。設定為0,表示不限制。

(推薦教學:nginx使用教學

nginx預設的客戶端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;
	....
	}

以上是修改nginx上傳檔案大小配置的詳細內容。更多資訊請關注PHP中文網其他相關文章!

陳述:
本文轉載於:csdn.net。如有侵權,請聯絡admin@php.cn刪除