Page 1 of 1

File Upload Limit

Posted: 19 Aug 2018, 15:39
by hwilms
Hi,

I am currently evaluating X3,and I am quite happy. However, today I ran into an issue: "Request Entity Too Large" while uploading files. Files are 1600 px max and some are larger than 1M. I have checked upload limits in nginx and php, both are set to 50M. How do I set a potential limit to 2 or 3M? Currently the limit seems to be set to 1M, which is OK in most cases, but not acceptable as a global limit (for me).

Re: File Upload Limit

Posted: 20 Aug 2018, 01:20
by mjau-mjau
hwilms wrote:I ran into an issue: "Request Entity Too Large" while uploading files.
I hadn't heard of this before, so I did some searching. Apparently, it's a NGINX-specific error, related to a client_max_body_size option. Check these links with simple solutions:
https://stackoverflow.com/questions/243 ... load-issue
https://www.cyberciti.biz/faq/linux-uni ... too-large/

Re: File Upload Limit

Posted: 20 Aug 2018, 04:56
by hwilms
Thanks for responding so quick. Unfortunately this does no seem to be the solution. As pointed out, I had checked my nginx and php configs in advance and set the client_max_body_size parameter to 50m according to the docs at http://nginx.org/en/docs/http/ngx_http_core_module.html#client_max_body_size. 

I have checked the access logs of nginx, too: 10.10.10.1 - - [20/Aug/2018:08:48:06 +0000] "POST /panel/filemanager_uploader.php HTTP/1.0" 200 9037 "https://h-art.photos/panel/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/11.1.2 Safari/605.1.15".

The POST received a 200, which should be fine.

Re: File Upload Limit

Posted: 20 Aug 2018, 05:27
by hwilms
I have set  `client_max_body_size 50m;` in all three definition blocks: server, location & http. No luck.

Re: File Upload Limit

Posted: 20 Aug 2018, 05:28
by hwilms
As you can see, I am using SSL and the issue might be related to this (in combination with client_max_body_size) ...

Re: File Upload Limit

Posted: 20 Aug 2018, 06:21
by hwilms
Hi, my hoster was able to resolve the issue. I will ask him about the solution and post it here.

Re: File Upload Limit

Posted: 20 Aug 2018, 06:23
by hwilms
In order to check, if the nginx conf is the issue, you can use the following curl: curl --insecure -H 'Content-Length: 10000000' https://127.0.0.1/. If there is an immediate answer "413 Request Entity Too Large", then you nginx config is wrong. Further details are coming later.

Re: File Upload Limit

Posted: 20 Aug 2018, 06:24
by hwilms
The content length depends on you upload limit, of course.

Re: File Upload Limit

Posted: 20 Aug 2018, 06:27
by mjau-mjau
Thanks for keeping up updated  :clap:

Re: File Upload Limit

Posted: 20 Aug 2018, 07:56
by hwilms
There is another nginx in front of the one, which is running X3, for SSL termination and caching. That one needed to be configured accordingly, too. Therefore setting  client_max_body_size to the desired value in all three definition blocks (server, location & http) is the solution :-).