I’m experiencing an issue where nginx and having a difficult time
determining the cause. It is timing out on an HTTPS PUT (to an HTTP
backend) when content length is greater than 16384 (per
$content_length) and it contains UTF-8 characters. The connection
hangs and I get a 408 returned by nginx after 60 seconds. When I make
the same call directly to the backend, it succeeds. Removing the UTF-8
characters or reducing the seize to 16384 or below will both allow the
request to succeed through nginx.
client_body_buffer_size is defaulting to 8k, and using
$request_body_file I’ve determined that it isn’t the use of a
temporary file triggering the error. Are there any other configuration
values that default to 16k?
My current nginx configuration:
nginx: nginx version: nginx/1.0.5
nginx: built by gcc 4.4.3 (Ubuntu 4.4.3-4ubuntu5)
nginx: TLS SNI support enabled
nginx: configure arguments: --conf-path=/etc/nginx
–prefix=/srv/nginx/1.0.5 --with-http_ssl_module
–with-http_stub_status_module --add-module=…/nginx-x-rid-header
–with-ld-opt=-luuid
I also tried 1.1.6 to see if its UTF-8 patch would help, to no avail:
nginx: nginx version: nginx/1.1.6
nginx: built by gcc 4.4.3 (Ubuntu 4.4.3-4ubuntu5)
nginx: TLS SNI support enabled
nginx: configure arguments: --conf-path=/etc/nginx
–prefix=/tmp/nginx-1.1.6 --with-http_ssl_module
–with-http_stub_status_module --add-module=…/nginx-x-rid-header
–with-ld-opt=-luuid
On Tue, Nov 01, 2011 at 01:00:25AM -0400, Bryan McLellan wrote:
$request_body_file I’ve determined that it isn’t the use of a
–with-ld-opt=-luuid
Successful PUT:
Failing PUT:
Bryan
Could you create debug log: A debugging log
What does this module do ?
–add-module=../nginx-x-rid-header
EOFError: end of file reached
from
/home/btm/.rvm/rubies/ruby-1.9.1-p431/lib/ruby/1.9.1/net/protocol.rb:135:in sysread' from /home/btm/.rvm/rubies/ruby-1.9.1-p431/lib/ruby/1.9.1/net/protocol.rb:135:in block in rbuf_fill’
from
/home/btm/.rvm/rubies/ruby-1.9.1-p431/lib/ruby/1.9.1/timeout.rb:52:in timeout' from /home/btm/.rvm/rubies/ruby-1.9.1-p431/lib/ruby/1.9.1/timeout.rb:82:in timeout’
from
/home/btm/.rvm/rubies/ruby-1.9.1-p431/lib/ruby/1.9.1/net/protocol.rb:134:in rbuf_fill' from /home/btm/.rvm/rubies/ruby-1.9.1-p431/lib/ruby/1.9.1/net/protocol.rb:116:in readuntil’
from
/home/btm/.rvm/rubies/ruby-1.9.1-p431/lib/ruby/1.9.1/net/protocol.rb:126:in readline' from /home/btm/.rvm/rubies/ruby-1.9.1-p431/lib/ruby/1.9.1/net/http.rb:2136:in read_status_line’
from
/home/btm/.rvm/rubies/ruby-1.9.1-p431/lib/ruby/1.9.1/net/http.rb:2125:in read_new' from /home/btm/.rvm/rubies/ruby-1.9.1-p431/lib/ruby/1.9.1/net/http.rb:1117:in transport_request’
from
/home/btm/.rvm/rubies/ruby-1.9.1-p431/lib/ruby/1.9.1/net/http.rb:1103:in request' from /home/btm/.rvm/rubies/ruby-1.9.1-p431/lib/ruby/1.9.1/net/http.rb:1096:in block in request’
from
/home/btm/.rvm/rubies/ruby-1.9.1-p431/lib/ruby/1.9.1/net/http.rb:564:in start' from /home/btm/.rvm/rubies/ruby-1.9.1-p431/lib/ruby/1.9.1/net/http.rb:1094:in request’
from
/home/btm/.rvm/gems/ruby-1.9.1-p431/gems/chef-0.10.4/lib/chef/rest/rest_request.rb:84:in block in call' from /home/btm/.rvm/gems/ruby-1.9.1-p431/gems/chef-0.10.4/lib/chef/rest/rest_request.rb:99:in hide_net_http_bug’
from
/home/btm/.rvm/gems/ruby-1.9.1-p431/gems/chef-0.10.4/lib/chef/rest/rest_request.rb:83:in call' from /home/btm/.rvm/gems/ruby-1.9.1-p431/gems/chef-0.10.4/lib/chef/rest.rb:219:in block in api_request’
from
/home/btm/.rvm/gems/ruby-1.9.1-p431/gems/chef-0.10.4/lib/chef/rest.rb:288:in retriable_rest_request' from /home/btm/.rvm/gems/ruby-1.9.1-p431/gems/chef-0.10.4/lib/chef/rest.rb:218:in api_request’
from
/home/btm/.rvm/gems/ruby-1.9.1-p431/gems/chef-0.10.4/lib/chef/rest.rb:130:in put_rest' from /home/btm/.rvm/gems/ruby-1.9.1-p431/gems/chef-0.10.4/lib/chef/node.rb:626:in save’
from (irb):9
from
/home/btm/.rvm/gems/ruby-1.9.1-p431/gems/chef-0.10.4/lib/chef/shef.rb:73:in block in start' from /home/btm/.rvm/gems/ruby-1.9.1-p431/gems/chef-0.10.4/lib/chef/shef.rb:72:in catch’
from
/home/btm/.rvm/gems/ruby-1.9.1-p431/gems/chef-0.10.4/lib/chef/shef.rb:72:in start' from /home/btm/.rvm/gems/ruby-1.9.1-p431/gems/chef-0.10.4/bin/shef:34:in <top (required)>’
from /home/btm/.rvm/gems/ruby-1.9.1-p431/bin/shef:19:in load' from /home/btm/.rvm/gems/ruby-1.9.1-p431/bin/shef:19:in 'chef >
quit
What does this module do ?
–add-module=../nginx-x-rid-header
It adds a header line with a uuid for associating frontend and backend
requests.
It fails without that module as well with this configuration:
nginx: nginx version: nginx/1.1.6
nginx: built by gcc 4.4.3 (Ubuntu 4.4.3-4ubuntu5)
nginx: TLS SNI support enabled
nginx: configure arguments: --conf-path=/etc/nginx
–prefix=/tmp/nginx-1.1.6 --with-http_ssl_module
–with-http_stub_status_module --with-debug
Here 16384 bytes has been read from client, and one byte remains
(“rest 1”). OpenSSL doesn’t provide any more bytes and claims it
needs more network input (2, SSL_ERROR_WANT_READ).