nginx 413请求实体太大(客户端意图发送太大的身体)

I know that this question has been asked multiple times but I have tried all of them and updated client_max_body_size to 0 and to even 16400M but it didn't help. I did asked my hosting support to restart the nginx and php fpm service too.

My server configuration is:

2GB RAM, Plesk server version : Plesk 12.5.30 Wordpress version : 4.6.1 PHP versoin : 7.0.12 set to run php at fastCGI application served by apache

The website is in wordpress and I can't even upload a file larger then 100mb from wordpress media uploader or through any other form.

From media uploader it gives this error in the ajax post request : POST

In my server logs I see this nginx error : 15271#0: *307 client intended to send too large body: 710634025 bytes

My /etc/nginx/nginx.conf code is :

#user  nginx;
worker_processes  1;

#error_log  /var/log/nginx/error.log;
#error_log  /var/log/nginx/error.log  notice;
#error_log  /var/log/nginx/error.log  info;

#pid        /var/run/;

include /etc/nginx/modules.conf.d/*.conf;

events {
    worker_connections  1024;

http {
client_max_body_size 0;
client_header_buffer_size 4k;
large_client_header_buffers  4 4k;
client_body_buffer_size  256k;
    include       mime.types;
    default_type  application/octet-stream;

    #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;

    #keepalive_timeout  0;
    keepalive_timeout  65;
    #tcp_nodelay        on;

    #gzip  on;
    #gzip_disable "MSIE [1-6]\.(?!.*SV1)";

    server_tokens off;

    include /etc/nginx/conf.d/*.conf;

# override global parameters e.g. worker_rlimit_nofile
include /etc/nginx/*global_params;

I am really hopeless now and not sure what to do. Smaller file uploads fine(100MB or so). Files larger then 100MB fails to upload.

Any help would be appreciated.

Update: Here is a link of phpinfo of website server:

2016/10/19 19:11
  • nginx
  • wordpress
  • php
  • 点赞
  • 收藏
  • 回答