See: <http://www.lamnk.com/blog/computer/fix-nginx-411-length-required-error/> http://www.lamnk.com/blog/computer/fix-nginx-411-length-required-error/
----- Uwe Schindler H.-H.-Meier-Allee 63, D-28213 Bremen <http://www.thetaphi.de/> http://www.thetaphi.de eMail: [email protected] From: Payne, Joe [mailto:[email protected]] Sent: Wednesday, June 19, 2013 6:59 PM To: [email protected] Subject: RE: solrj content-length header missing This is happening on version 1.2.7 of Nginx. Newer versions do not produce this error, but getting that updated is another battle. The error message it returns is 411: Length Required. From: Uwe Schindler [mailto:[email protected]] Sent: Wednesday, June 19, 2013 12:29 PM To: [email protected] Subject: RE: solrj content-length header missing Hi, POST (or any other request that sends data to HTTP endpoint) always needs the length of the body, but there are two options: - If you know the length you *may* set it before (this was required in HTTP/1.0). - HTTP/1.1 added chunked transfer encoding, so the POST data is sent as smaller chunks, each with its own length header. This is the preferred way to send content, if the size is not known (which is not the case for data sent by the solr client library without buffering it completely which has a negative impact on response times and memory requirements). Depending on the size of the POST data, HttpSolrServer decides internally if it can set content-length (if the body is smaller than the buffer size and chunking is not needed) or not. This is handled by the underlying HttpClient library ( <http://hc.apache.org/> http://hc.apache.org/). What is the problem / error message of nginx? Uwe ----- Uwe Schindler H.-H.-Meier-Allee 63, D-28213 Bremen <http://www.thetaphi.de/> http://www.thetaphi.de eMail: [email protected] From: Payne, Joe [mailto:[email protected]] Sent: Wednesday, June 19, 2013 5:53 PM To: [email protected] Subject: solrj content-length header missing We are trying to use Nginx to do load balancing and it does not like that the content-length header is missing on a POST with an <add>…</add> document. I looked in the code and did not find anything about setting the header. (http://svn.apache.org/viewvc/lucene/dev/trunk/solr/solrj/src/java/org/apache/solr/client/solrj/impl/HttpSolrServer.java?view=markup). Are there plans to add the content-length header in future versions? Joe _____ This e-mail message, including any attachments, is for the sole use of the intended recipient(s) and may contain information that is confidential and protected by law from unauthorized disclosure. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message. _____ This e-mail message, including any attachments, is for the sole use of the intended recipient(s) and may contain information that is confidential and protected by law from unauthorized disclosure. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message.
