Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Apache server as proxy to Jboss problem

Currently my web application is running on jboss but I have an apache server that is used as a proxy to my application. I have the ability to upload XML files on my jboss server. When it is uploaded, it returns HTTP 200 and XML response Content-Type: text/xml.

Some users use this feature on apache instance that redirects to jboss. These users sometimes use Content-Type: application/xml when they upload file and Accept: / header. With this header jboss does the work 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.0.63 (Unix) mod_jk/1.2.27
< Content-Length: 232
< Content-Type: text/html; charset=iso-8859-1
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>502 Bad Gateway</title>
</head><body>
<h1>Bad Gateway</h1>
<p>The proxy server received an invalid
response from an upstream server.<br />
</p>

Why does it happen when users use application/xml instead of text/xml header value? Does apache compare these headers in some way? When users use text/xml value everything is ok and apache prints jboss 200 OK response.

like image 611
breedish Avatar asked Feb 03 '11 10:02

breedish


1 Answers

I guess you are using apache2 . edit this file /etc/apache2/modsenabled/mime.conf add one line AddType application/xml .xml

--kiran.kumar

like image 153
kiran.kumar M Avatar answered Nov 03 '22 08:11

kiran.kumar M