[Mule] Error 400 Bad Request, Request Header Or Cookie Too Large
I had an error yersterday, when connecting Mule ESB to NGinx. Very weird, because somehow it never shown any errors when fired directly without a reverse proxy. Here is the complete stacktrace
<head><title>400 Request Header Or Cookie Too Large</title></head> <body bgcolor="white"> <center><h1>400 Bad Request</h1></center> <center>Request Header Or Cookie Too Large</center> <hr><center>nginx/1.4.4</center> </body> </html> (javax.xml.ws.soap.SOAPFaultException) org.apache.cxf.jaxws.JaxWsClientProxy:156 (http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/xml/ws/soap/SOAPFaultException.html) 3. Response was of unexpected text/html ContentType. Incoming portion of HTML stream: <html> <head><title>400 Request Header Or Cookie Too Large</title></head> <body bgcolor="white"> <center><h1>400 Bad Request</h1></center> <center>Request Header Or Cookie Too Large</center> <hr><center>nginx/1.4.4</center> </body> </html>
It happens because Mule, by default, send a very large cookies called “X-MULE_SESSION”. After removing it, my ESB runs well again. This is how i remove it,
<http:connector name="NoSessionConnector"> <service-overrides sessionHandler="org.mule.session.NullSessionHandler"/> </http:connector>