Presently my web application is running on jboss however i come with an apache server that's used like a proxy to my application. I be capable of upload XML files on my small jboss server. When it's submitted, it returns HTTP 200 and XML response Content-Type: text/xml.

Some customers make use of this feature on apache instance that redirects to jboss. These customers sometimes use Content-Type: application/xml once they upload file and Accept: / header. With this particular header jboss does the job OK, but apache always returns bad response:

HTTP/1.1 502 Bad Gateway

< Date: Mon, 31 Jan 2011 23:33:47 GMT

< Server: Apache/2..63 (Unix) mod_jk/1.2.27

< Content-Length: 232

< Content-Type: text/html charset=iso-8859-1



<title>502 Bad Gateway</title>


<h1>Bad Gateway</h1>

<p>The proxy server received an invalid

response from an upstream server.<br />


How come it happen when customers use application/xml rather than text/xml header value? Does apache compare these headers in some manner? When customers use text/xml value things are ok and apache prints jboss 200 OK response.

I suppose you're using apache2 . edit this file /etc/apache2/modsenabled/mime.conf add one line AddType application/xml .xml


You may want to examine mime.types file within the httpd/conf directory (usually somewhere such as the /usr/httpd/conf or /etc/httpd/conf directory) and hang file extensions for application/xml just like looking for text/xml .