VMN
VMN

Reputation: 181

413 Request Entity Too Large nginx

I am trying to increase the upload limit on my PHP application to 512MB by changing the nginx.conf as follows -

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

But however it still seems to be capped at 120MB

Can someone please help make changes to accept files beyond 120mb

Thank you..

Upvotes: 1

Views: 1864

Answers (1)

Ryan
Ryan

Reputation: 81

Look at your php.ini file:

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

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

it will need to match your nginx config

Upvotes: 3

Related Questions