For volumetric POST get 404 error, why?

Hello! My site is wiziwig editor.

When I insert picture from my computer, the editor creates the img tag and the src registers the contents of the picture, encoded in base64. That is, even if insert picture 2x2 pixel, then the number of characters that generates WYSIWYG-editor of more than a hundred.

The problem is that if you try to insert a large picture, which weighs in at 1.5 megabytes, and submit the form, then there is a redirect on 404 error. Because in this case, the number of characters will be almost 2 million. And that two million I am trying to convey in the POST.

Error log is empty. After submitting the form trying to get all the data just using print_r($_POST), and even in this case there is a redirect on 404 at the big picture, and with a small norm.

Are there any restrictions on the length of the string in the POST? Or is there some solution on the client side before submitting the form, the picture shrank like something or gets drawn in lower resolution, for example, using JS?

UPD: Added source code.
<form method="POST" action="/cabinet/new/" id="new_case" autocomplete="off" enctype="multipart/form-data">
 <textarea id="summernote" name="new_case_body"></textarea>
 <input type="submit" name="new_case" id="fs" value="Save">
</form>


And the handler:
if (isset($_POST['new_case'])) {
print_r($_POST);exit;
}


It should be noted that the server is CNC.
That is, in the action form I have specified /cabinet/new/, but in fact the server sends to /index.php?r=/cabinet/new/ and then using require I load the relevant module, for example, cabinet_new.php
Works like this:
RewriteEngine On

RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [QSA,R=301,L] 

RewriteCond %{HTTP_HOST} ^www\.(.*)$
RewriteRule ^(.*)$ https://%1/$1 [R=301,L]

RewriteCond %{REQUEST_FILENAME} !-d 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_URI} /+[^\.]+$
RewriteRule ^(.+[^/])$ %{REQUEST_URI}/ [R=301,L]
RewriteRule \.(php|html|swf|fla|xml|ico|jpg|gif|png|txt|js|css|eot|ttf|woff|map)$ - [L]
RewriteRule ^(.*)$ index.php?r=$1 [L,QSA]


Settings are:
memory_limit = 128M
post_max_size = 32M
upload_max_filesize = 2M


UPD2
Conducted a test. Insert in text box 1 000 000 characters (almost 1MB), everything works fine.
Put a little more — 1 100 000, submitted the form, redirect to a 404
It means that somewhere there is a limit to the length of the POST more than 1MB.
Support says there are no restrictions.
Increased the upload_max_filesize to 16M, still 404
June 5th 19 at 21:53
1 answer
June 5th 19 at 21:55
post_max_size
php.net/manual/ru/ini.core.php#ini.post-max-size

There is also max_upload_filesize
This does not solve the problem.
First, if you exceed the limit of post_max_size variable POST should just be empty, and I redirect to 404.
Second, set post_max_size 32M, and data that is adjusted to the 404 weighs only 1.8 MB - Caterina.Blan commented on June 5th 19 at 21:58
about the redirect — you need code to watch - Mohamed_Lind75 commented on June 5th 19 at 22:01
updated the question text, added the source. - Caterina.Blan commented on June 5th 19 at 22:04
why not see a mistake as I think there is a catch the exception above
times gives 404 after exit; - Mohamed_Lind75 commented on June 5th 19 at 22:07

Find more questions by tags PHPApache