Search…

X3 Photo Gallery Support Forums

Search…
 
hwilms
Topic Author
Posts: 13
Joined: 11 Aug 2018, 15:49

File Upload Limit

19 Aug 2018, 15:39

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).
 
User avatar
mjau-mjau
X3 Wizard
Posts: 13993
Joined: 30 Sep 2006, 03:37

Re: File Upload Limit

20 Aug 2018, 01:20

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/
 
hwilms
Topic Author
Posts: 13
Joined: 11 Aug 2018, 15:49

Re: File Upload Limit

20 Aug 2018, 04:56

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.
 
hwilms
Topic Author
Posts: 13
Joined: 11 Aug 2018, 15:49

Re: File Upload Limit

20 Aug 2018, 05:27

I have set  `client_max_body_size 50m;` in all three definition blocks: server, location & http. No luck.
 
hwilms
Topic Author
Posts: 13
Joined: 11 Aug 2018, 15:49

Re: File Upload Limit

20 Aug 2018, 05:28

As you can see, I am using SSL and the issue might be related to this (in combination with client_max_body_size) ...
 
hwilms
Topic Author
Posts: 13
Joined: 11 Aug 2018, 15:49

Re: File Upload Limit

20 Aug 2018, 06:21

Hi, my hoster was able to resolve the issue. I will ask him about the solution and post it here.
 
hwilms
Topic Author
Posts: 13
Joined: 11 Aug 2018, 15:49

Re: File Upload Limit

20 Aug 2018, 06:23

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.
 
hwilms
Topic Author
Posts: 13
Joined: 11 Aug 2018, 15:49

Re: File Upload Limit

20 Aug 2018, 06:24

The content length depends on you upload limit, of course.
 
User avatar
mjau-mjau
X3 Wizard
Posts: 13993
Joined: 30 Sep 2006, 03:37

Re: File Upload Limit

20 Aug 2018, 06:27

Thanks for keeping up updated  :clap:
 
hwilms
Topic Author
Posts: 13
Joined: 11 Aug 2018, 15:49

Re: File Upload Limit

20 Aug 2018, 07:56

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 :-).