0
votes

I have a script (similar to youtube) on my Dedicated root server, but I can not upload large video files.

I get this error message:

413 Request Entity Too Large nginx

The programmer has written a php file, which directly displays the error message.

I have already adjusted the nginx.conf, but the error remains.

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

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

events {

    worker_connections 1024;

}

http {

    include       mime.types;
    default_type  application/octet-stream;
    client_max_body_size 4096M;

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

    server {

       client_max_body_size 4096M;

    location / {

       client_max_body_size 4096M;

    }
  }
}

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

These data are set in the php.ini:

  • PHP 7.0.33
  • memory_limit 4096M
  • max_execution_time 7200
  • max_input_time 7200
  • post_max_size 4096M upload_max_filesize 4096M

Can someone help me? Where do I have to change something so I can upload large video files.

Thank you!

1
did you bother to google this before asking? first hit by just searching your error message: cyberciti.biz/faq/…zuckerburg
Yes, I googled it before I asked here. I have made all these changes, but unfortunately the error message persists.Maik
I just found a file located in this directory: /etc/nginx/plesk.conf.d/vhosts In this file is "client_max_body_size 128m;" and top "DO NOT MODIFY THIS FILE BECAUSE IT WAS GENERATED AUTOMATICALLY, SO ALL YOUR CHANGES WILL BE LOST THE NEXT TIME THE FILE IS GENERATED." Can I change this somewhere !?Maik

1 Answers

0
votes

What you have there is great, add the same client_max_body_size 4096M; to your nginx default file or whatever you have created.

This file i am talking of is in the site-available directory.

When you are done editing the file, reload daemon, and then restart nginx.

And from what you have above kindly remove or comment out the one in the location block.

Let me know if this was helpful