Issue
I have a web application in Wildfly and when I'm trying to upload a file bigger than 10MB, I'm getting the following error:
io.undertow.server.RequestTooBigException: UT000020: Connection terminated as request was larger than 10485760
Please, how can I solve this error?
Solution
I solved my problem by putting the max-post-size in the standalone.xml, as the example below:
<subsystem xmlns="urn:jboss:domain:undertow:3.1">
<buffer-cache name="default"/>
<server name="default-server">
<ajp-listener name="ajp" max-post-size="1073741824" socket-binding="ajp"/>
<http-listener name="default" max-post-size="1073741824" socket-binding="http" redirect-socket="https"/>
<https-listener name="https" max-post-size="1073741824" socket-binding="https" security-realm="ApplicationRealm"/>
...
</server>
...
In this example, the value is configurated to 1GB, but you can configure the value you want.
If you use Nginx, don't forget to configure the client_max_body_size.
Helpful links:
https://access.redhat.com/solutions/3084671
http://www.mastertheboss.com/web/jboss-web-server/configuring-wildfly-upload-file-size/
Answered By - Thiago G. Alves
Answer Checked By - Gilberto Lyons (JavaFixing Admin)