1. 程式人生 > >解決 nginx 出現 413 Request Entity Too Large 的問題

解決 nginx 出現 413 Request Entity Too Large 的問題

xxxx light pos req star 題解 clas 字段 ...

1.若nginx用所用的 php 請求解析服務是 fpm, 則檢查 /etc/php5/fpm/php.ini 文件中的參數

upload_max_filesize = 20M
post_max_size = 20M

重啟fpm服務

  service php5-fpm restart

然後上傳20M以內的文件,若仍出現 413 錯誤,則排除 php.ini 的問題

2.在 /etc/nginx/sites-enabled/xxxx 網站配置中加入下面字段

    server {
        ...
        client_max_body_size 20m;
        ...
    }


重啟nginx服務

  service nginx restart

問題解決!

解決 nginx 出現 413 Request Entity Too Large 的問題