4

I am receiving a "Bad Gateway The proxy server received an invalid response from an upstream server" error while trying to upload a 20MB file.

The problem starts in pre-production when I access the page via Apache. Any file over 10MB gives the above error. The Apache and JBOSS are configured via MOD_JK.

There is nothing in the Apache Log whereas in the JBOSS log there is an error "org.apache.commons.fileupload.FileUploadException: Processing of multipart/form-data request failed. UT000020: Connection terminated as request was larger than 10485760"

If I access the JBOSS directly bypassing Apache web server, the file is uploaded successfully. I changed the maxpostsize in the JBOSS undertow subsystem which made is possible to load via JBOSS.

I wanted to know what is the equivalent of "maxpostsize" directive in Apache Web server? There is some default configuration limiting the file upload size to 10MB in Apache. I just want to increase that limit.

Any help would be appreciated.

Regards,

Sully
  • 41
  • 1
  • 2

3 Answers3

2

You have to edit your Jboss / Wildfly Settings in standalone.xml In Subsystem Undertow you have to set max-post-size="" parameter (default = 10485760) in your used Listener (http-listener default) When you'r using AJP Connection to Apache you have to set this parameter in ajp-listener

   <subsystem xmlns="urn:jboss:domain:undertow:2.0">
        <buffer-cache name="default"/>
        <server name="default-server">
             <ajp-listener name="ajp" socket-binding="ajp" max-post-size="104857600" />
...

Example for 100MB max File Size and using ajp-listener

0

Adding max-post-size to ajp-listenner solved the issue when I run JBoss in domain mode.

<subsystem xmlns="urn:jboss:domain:undertow:3.1">
            <buffer-cache name="default"/>
            <server name="default-server">
                <ajp-listener name="ajp" max-post-size="104857600" socket-binding="ajp"/>
Jerry
  • 97
  • 5
0

Increase max-post-size (10485760 = 10MiB by default) on your listeners in the undertow subsystem to accept large file post requests. For example, setting max-post-size to 31457280 (= 30MB):

<subsystem xmlns="urn:jboss:domain:undertow:3.1">
<buffer-cache name="default"/>
<server name="default-server">
    <ajp-listener name="ajp" max-post-size="31457280" socket-binding="ajp"/>
    <http-listener name="default" max-post-size="31457280" socket-binding="http" redirect-socket="https"/>
    <https-listener name="https" max-post-size="31457280" socket-binding="https" security-realm="ApplicationRealm"/>
    ...
</server>
...

https://access.redhat.com/solutions/3084671