So, I have an apache 2.2.16 (64 bit) installed on a Debian Server.
I have configured a proxy, for a specific url to map to my backend Tomcat 7 server.
Everything works fine for all of the GET/POST requests except for multipart POST requests.
The error log of apache is showing the followinf lines:
[error] [client CLIENT_IP] (20014)Internal error: proxy: error reading status line from remote server TOMCAT_IP:8081
[error] [client CLIENT_IP] proxy: Error reading from remote server returned by /svc/document
Strange thing is that POST multipart works fine if I upload a ZERO Kb file, but fails with other files (no more than a few bytes). And everything, including uploads works fine on my developing environment (XAMPP + mod_proxy + tomcat)
Tomcat 7 connector:
<Connector port="8081" protocol="HTTP/1.1" address="TOMCAT_IP" maxThreads="6000"
connectionTimeout="40000" URIEncoding="UTF-8" maxPostSize="8388608"
redirectPort="8443" />
Proxy is configured as follows:
<VirtualHost *:80>
DocumentRoot /var/www/frontend/
ServerName frontend.com
ProxyPass /svc/ http://[TOMCAT_IP]:8081/web/ connectiontimeout=40 timeout=60 Keepalive=On min=20 acquire=20 retry=1
</VirtualHost>
I even tried some suggestions, one by one and all in once, as found on similar question, but with no luck:
<VirtualHost *:80>
DocumentRoot /var/www/frontend/
ServerName frontend.com
ProxyPass /svc/ http://[TOMCAT_IP]:8081/web/ connectiontimeout=40 timeout=60 Keepalive=On min=20 acquire=20 retry=1
ProxyBadHeader Ignore
ProxyRequests Off
LimitRequestBody 8388608
SetEnv proxy-sendchunked 1
</VirtualHost>
I tried ProxyPassReverse, raise timeout, ProxyBadHeader Ignore, setenv proxy-initial-not-pooled 1 etc. nothing seems to work… Any idea?
Best Answer
So, for anyone's curiosity and for any future reference:
There was no problem at all, neither on Tomcat side, nor on proxy side. Problem was relying on the network in-between. Seems that one switch/router had no MTU configured (not sure what it is, that's what the network guy said) so the communication link would brake if packet/frame negotiation failed for packets bigger than a few hundred bytes.