413请求实体太大nginx

时间:2014-11-27 10:50:33

标签: php nginx

我正在尝试通过更改nginx.conf将我的PHP应用程序的上传限制增加到512MB -

#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/nginx.pid;


events {
    worker_connections  1024;
}


http {
    include       mime.types;
    default_type  application/octet-stream;
    client_max_body_size 512M;
    #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  6500;
    #tcp_nodelay        on;

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

    server_tokens off;

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

但是它似乎仍然限制在120MB

有人可以帮助进行更改以接受超过120mb的文件

谢谢..

1 个答案:

答案 0 :(得分:2)

查看你的php.ini文件:

; Maximum allowed size for uploaded files.
upload_max_filesize = 512M

; Must be greater than or equal to upload_max_filesize
post_max_size = 512M

它需要匹配你的nginx配置