Welcome! Log In Create A New Profile

Advanced

Error 413 on long query string

Posted by dobesv 
Error 413 on long query string
January 22, 2010 04:12PM
Hi there,

I have a flash widget that uses a really long 1400 character URI to fetch it's data.

For some reason nginx is returning an error 413 back when I try to use this in Chrome. This used to affect all browsers but I bumped the buffers and that fixed it for everyone else. However, for Google Chrome I'm still seeing this.

The request is supposed to be proxied via HTTP to a Jetty backend. The backend isn't showing any request in its access log so it appears that nginx is rejecting the request with error 413. Nothing is printed into the nginx error.log.

Here's a sample from the access log:

[code]
10.8.94.33 - - [22/Jan/2010:12:52:36 -0800] "GET /app/report?format=xmlswf&chart=true&nocache=1264193555789&chart_type=l
ine&skip=16&line_thickness=2&point_size=3&fill_shape=true&report=t%3DBANK_BALANCE%26asOf%3D2010-1-22%26summary%3Dtrue%26
id%3D4477%26withTotals%3Dfalse%26limit%3D10%26cols%3Dnull%3Aweeks%3A52%3Bnull%3Aweeks%3A51%3Bnull%3Aweeks%3A50%3Bnull%3A
weeks%3A49%3Bnull%3Aweeks%3A48%3Bnull%3Aweeks%3A47%3Bnull%3Aweeks%3A46%3Bnull%3Aweeks%3A45%3Bnull%3Aweeks%3A44%3Bnull%3A
weeks%3A43%3Bnull%3Aweeks%3A42%3Bnull%3Aweeks%3A41%3Bnull%3Aweeks%3A40%3Bnull%3Aweeks%3A39%3Bnull%3Aweeks%3A38%3Bnull%3A
weeks%3A37%3Bnull%3Aweeks%3A36%3Bnull%3Aweeks%3A35%3Bnull%3Aweeks%3A34%3Bnull%3Aweeks%3A33%3Bnull%3Aweeks%3A32%3Bnull%3A
weeks%3A31%3Bnull%3Aweeks%3A30%3Bnull%3Aweeks%3A29%3Bnull%3Aweeks%3A28%3Bnull%3Aweeks%3A27%3Bnull%3Aweeks%3A26%3Bnull%3A
weeks%3A25%3Bnull%3Aweeks%3A24%3Bnull%3Aweeks%3A23%3Bnull%3Aweeks%3A22%3Bnull%3Aweeks%3A21%3Bnull%3Aweeks%3A20%3Bnull%3A
weeks%3A19%3Bnull%3Aweeks%3A18%3Bnull%3Aweeks%3A17%3Bnull%3Aweeks%3A16%3Bnull%3Aweeks%3A15%3Bnull%3Aweeks%3A14%3Bnull%3A
weeks%3A13%3Bnull%3Aweeks%3A12%3Bnull%3Aweeks%3A11%3Bnull%3Aweeks%3A10%3Bnull%3Aweeks%3A9%3Bnull%3Aweeks%3A8%3Bnull%3Awe
eks%3A7%3Bnull%3Aweeks%3A6%3Bnull%3Aweeks%3A5%3Bnull%3Aweeks%3A4%3Bnull%3Aweeks%3A3%3Bnull%3Aweeks%3A2%3Bnull%3Aweeks%3A
1%3Bnull%3Aweeks%3A0%3B%26&auth=42f6cbf0-21d4-4ee8-8396-0f93404f2298 HTTP/1.1" 413 5 "https://www.clarityaccounting.com/
app/swf/charts.swf?library_path=https%3A%2F%2Fwww.clarityaccounting.com%2Fapp%2Fswf%2Fcharts_library&xml_source=https%3A
%2F%2Fwww.clarityaccounting.com%2Fapp%2Freport%3Fformat%3Dxmlswf%26chart%3Dtrue%26nocache%3D1264193555789%26chart_type%3
Dline%26skip%3D16%26line_thickness%3D2%26point_size%3D3%26fill_shape%3Dtrue%26report%3Dt%253DBANK_BALANCE%2526asOf%253D2
010-1-22%2526summary%253Dtrue%2526id%253D4477%2526withTotals%253Dfalse%2526limit%253D10%2526cols%253Dnull%253Aweeks%253A
52%253Bnull%253Aweeks%253A51%253Bnull%253Aweeks%253A50%253Bnull%253Aweeks%253A49%253Bnull%253Aweeks%253A48%253Bnull%253A
weeks%253A47%253Bnull%253Aweeks%253A46%253Bnull%253Aweeks%253A45%253Bnull%253Aweeks%253A44%253Bnull%253Aweeks%253A43%253
Bnull%253Aweeks%253A42%253Bnull%253Aweeks%253A41%253Bnull%253Aweeks%253A40%253Bnull%253Aweeks%253A39%253Bnull%253Aweeks%
253A38%253Bnull%253Aweeks%253A37%253Bnull%253Aweeks%253A36%253Bnull%253Aweeks%253A35%253Bnull%253Aweeks%253A34%253Bnull%
253Aweeks%253A33%253Bnull%253Aweeks%253A32%253Bnull%253Aweeks%253A31%253Bnull%253Aweeks%253A30%253Bnull%253Aweeks%253A29
%253Bnull%253Aweeks%253A28%253Bnull%253Aweeks%253A27%253Bnull%253Aweeks%253A26%253Bnull%253Aweeks%253A25%253Bnull%253Awe
eks%253A24%253Bnull%253Aweeks%253A23%253Bnull%253Aweeks%253A22%253Bnull%253Aweeks%253A21%253Bnull%253Aweeks%253A20%253Bn
ull%253Aweeks%253A19%253Bnull%253Aweeks%253A18%253Bnull%253Aweeks%253A17%253Bnull%253Aweeks%253A16%253Bnull%253Aweeks%25
3A15%253Bnull%253Aweeks%253A14%253Bnull%253Aweeks%253A13%253Bnull%253Aweeks%253A12%253Bnull%253Aweeks%253A11%253Bnull%25
3Aweeks%253A10%253Bnull%253Aweeks%253A9%253Bnull%253Aweeks%253A8%253Bnull%253Aweeks%253A7%253Bnull%253Aweeks%253A6%253Bn
ull%253Aweeks%253A5%253Bnull%253Aweeks%253A4%253Bnull%253Aweeks%253A3%253Bnull%253Aweeks%253A2%253Bnull%253Aweeks%253A1%
253Bnull%253Aweeks%253A0%253B%2526%26auth%3D42f6cbf0-21d4-4ee8-8396-0f93404f2298" "Mozilla/5.0 (Windows; U; Windows NT 6
.0; en-US) AppleWebKit/532.0 (KHTML, like Gecko) Chrome/3.0.195.38 Safari/532.0"
[/code]

Here's how I've configured my buffers:

[code]
proxy_buffering off;

client_header_buffer_size 8k;
large_client_header_buffers 4 8k; # Allow large request URIs and headers
client_max_body_size 4m;
client_body_buffer_size 128K;
[/code]

Here's the version information:

[code]
nginx version: nginx/0.8.32
built by gcc 4.1.2 20080704 (Red Hat 4.1.2-44)
TLS SNI support disabled
configure arguments: --prefix=/usr --sbin-path=/usr/sbin/nginx --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/l
og/nginx/error.log --pid-path=/var/run/nginx.pid --lock-path=/var/lock/nginx.lock --user=nginx --group=nginx --with-http
_ssl_module --with-http_gzip_static_module --http-log-path=/var/log/nginx/access.log --http-client-body-temp-path=/var/t
mp/nginx/client/ --http-proxy-temp-path=/var/tmp/nginx/proxy --without-http_autoindex_module --without-http_auth_basic_m
odule --without-http_ssi_module --with-http_realip_module --with-http_stub_status_module
[/code]

Does anyone know why this would be? It seems like everything is configured to allow large requests to come through, so I shouldn't be getting any error 413 responses ... and yet here's an error 413!

Any help appreciated!
Re: Error 413 on long query string
January 23, 2010 01:35AM
On further investigation I think it is the referer: header that is causing the request to be rejected; the referer when using chrome is a long URL but in IE it is a shorter value. Here's the actual raw requests:

Chrome (rejected):

[code]
GET /app/report?format=xmlswf&chart=true&nocache=1264228009320&chart_type=line&skip=16&line_thickness=2&point_size=3&fill_shape=true&report=t%3DBANK_BALANCE%26asOf%3D2010-1-22%26summary%3Dtrue%26id%3D4477%26withTotals%3Dfalse%26limit%3D10%26cols%3Dnull%3Aweeks%3A52%3Bnull%3Aweeks%3A51%3Bnull%3Aweeks%3A50%3Bnull%3Aweeks%3A49%3Bnull%3Aweeks%3A48%3Bnull%3Aweeks%3A47%3Bnull%3Aweeks%3A46%3Bnull%3Aweeks%3A45%3Bnull%3Aweeks%3A44%3Bnull%3Aweeks%3A43%3Bnull%3Aweeks%3A42%3Bnull%3Aweeks%3A41%3Bnull%3Aweeks%3A40%3Bnull%3Aweeks%3A39%3Bnull%3Aweeks%3A38%3Bnull%3Aweeks%3A37%3Bnull%3Aweeks%3A36%3Bnull%3Aweeks%3A35%3Bnull%3Aweeks%3A34%3Bnull%3Aweeks%3A33%3Bnull%3Aweeks%3A32%3Bnull%3Aweeks%3A31%3Bnull%3Aweeks%3A30%3Bnull%3Aweeks%3A29%3Bnull%3Aweeks%3A28%3Bnull%3Aweeks%3A27%3Bnull%3Aweeks%3A26%3Bnull%3Aweeks%3A25%3Bnull%3Aweeks%3A24%3Bnull%3Aweeks%3A23%3Bnull%3Aweeks%3A22%3Bnull%3Aweeks%3A21%3Bnull%3Aweeks%3A20%3Bnull%3Aweeks%3A19%3Bnull%3Aweeks%3A18%3Bnull%3Aweeks%3A17%3Bnull%3Aweeks%3A16%3Bnull%3Aweeks%3A15%3Bnull%3Aweeks%3A14%3Bnull%3Aweeks%3A13%3Bnull%3Aweeks%3A12%3Bnull%3Aweeks%3A11%3Bnull%3Aweeks%3A10%3Bnull%3Aweeks%3A9%3Bnull%3Aweeks%3A8%3Bnull%3Aweeks%3A7%3Bnull%3Aweeks%3A6%3Bnull%3Aweeks%3A5%3Bnull%3Aweeks%3A4%3Bnull%3Aweeks%3A3%3Bnull%3Aweeks%3A2%3Bnull%3Aweeks%3A1%3Bnull%3Aweeks%3A0%3B%26&auth=**** HTTP/1.1
Host: www.clarityaccounting.com
Connection: keep-alive
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/532.0 (KHTML, like Gecko) Chrome/3.0.195.38 Safari/532.0
Referer: https://www.clarityaccounting.com/app/swf/charts.swf?library_path=https%3A%2F%2Fwww.clarityaccounting.com%2Fapp%2Fswf%2Fcharts_library&xml_source=https%3A%2F%2Fwww.clarityaccounting.com%2Fapp%2Freport%3Fformat%3Dxmlswf%26chart%3Dtrue%26nocache%3D1264228009320%26chart_type%3Dline%26skip%3D16%26line_thickness%3D2%26point_size%3D3%26fill_shape%3Dtrue%26report%3Dt%253DBANK_BALANCE%2526asOf%253D2010-1-22%2526summary%253Dtrue%2526id%253D4477%2526withTotals%253Dfalse%2526limit%253D10%2526cols%253Dnull%253Aweeks%253A52%253Bnull%253Aweeks%253A51%253Bnull%253Aweeks%253A50%253Bnull%253Aweeks%253A49%253Bnull%253Aweeks%253A48%253Bnull%253Aweeks%253A47%253Bnull%253Aweeks%253A46%253Bnull%253Aweeks%253A45%253Bnull%253Aweeks%253A44%253Bnull%253Aweeks%253A43%253Bnull%253Aweeks%253A42%253Bnull%253Aweeks%253A41%253Bnull%253Aweeks%253A40%253Bnull%253Aweeks%253A39%253Bnull%253Aweeks%253A38%253Bnull%253Aweeks%253A37%253Bnull%253Aweeks%253A36%253Bnull%253Aweeks%253A35%253Bnull%253Aweeks%253A34%253Bnull%253Aweeks%253A33%253Bnull%253Aweeks%253A32%253Bnull%253Aweeks%253A31%253Bnull%253Aweeks%253A30%253Bnull%253Aweeks%253A29%253Bnull%253Aweeks%253A28%253Bnull%253Aweeks%253A27%253Bnull%253Aweeks%253A26%253Bnull%253Aweeks%253A25%253Bnull%253Aweeks%253A24%253Bnull%253Aweeks%253A23%253Bnull%253Aweeks%253A22%253Bnull%253Aweeks%253A21%253Bnull%253Aweeks%253A20%253Bnull%253Aweeks%253A19%253Bnull%253Aweeks%253A18%253Bnull%253Aweeks%253A17%253Bnull%253Aweeks%253A16%253Bnull%253Aweeks%253A15%253Bnull%253Aweeks%253A14%253Bnull%253Aweeks%253A13%253Bnull%253Aweeks%253A12%253Bnull%253Aweeks%253A11%253Bnull%253Aweeks%253A10%253Bnull%253Aweeks%253A9%253Bnull%253Aweeks%253A8%253Bnull%253Aweeks%253A7%253Bnull%253Aweeks%253A6%253Bnull%253Aweeks%253A5%253Bnull%253Aweeks%253A4%253Bnull%253Aweeks%253A3%253Bnull%253Aweeks%253A2%253Bnull%253Aweeks%253A1%253Bnull%253Aweeks%253A0%253B%2526%26auth%3D****
Accept: */*
Accept-Encoding: gzip,deflate,sdch
Cookie: *****
Accept-Language: en-US,en;q=0.8
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3

[/code]

IE (works):

[code]
GET /app/report?format=xmlswf&chart=true&nocache=1264228226132&chart_type=line&skip=16&line_thickness=2&point_size=3&fill_shape=true&report=t%3DBANK_BALANCE%26asOf%3D2010-1-22%26summary%3Dtrue%26id%3D4477%26withTotals%3Dfalse%26limit%3D10%26cols%3Dnull%3Aweeks%3A52%3Bnull%3Aweeks%3A51%3Bnull%3Aweeks%3A50%3Bnull%3Aweeks%3A49%3Bnull%3Aweeks%3A48%3Bnull%3Aweeks%3A47%3Bnull%3Aweeks%3A46%3Bnull%3Aweeks%3A45%3Bnull%3Aweeks%3A44%3Bnull%3Aweeks%3A43%3Bnull%3Aweeks%3A42%3Bnull%3Aweeks%3A41%3Bnull%3Aweeks%3A40%3Bnull%3Aweeks%3A39%3Bnull%3Aweeks%3A38%3Bnull%3Aweeks%3A37%3Bnull%3Aweeks%3A36%3Bnull%3Aweeks%3A35%3Bnull%3Aweeks%3A34%3Bnull%3Aweeks%3A33%3Bnull%3Aweeks%3A32%3Bnull%3Aweeks%3A31%3Bnull%3Aweeks%3A30%3Bnull%3Aweeks%3A29%3Bnull%3Aweeks%3A28%3Bnull%3Aweeks%3A27%3Bnull%3Aweeks%3A26%3Bnull%3Aweeks%3A25%3Bnull%3Aweeks%3A24%3Bnull%3Aweeks%3A23%3Bnull%3Aweeks%3A22%3Bnull%3Aweeks%3A21%3Bnull%3Aweeks%3A20%3Bnull%3Aweeks%3A19%3Bnull%3Aweeks%3A18%3Bnull%3Aweeks%3A17%3Bnull%3Aweeks%3A16%3Bnull%3Aweeks%3A15%3Bnull%3Aweeks%3A14%3Bnull%3Aweeks%3A13%3Bnull%3Aweeks%3A12%3Bnull%3Aweeks%3A11%3Bnull%3Aweeks%3A10%3Bnull%3Aweeks%3A9%3Bnull%3Aweeks%3A8%3Bnull%3Aweeks%3A7%3Bnull%3Aweeks%3A6%3Bnull%3Aweeks%3A5%3Bnull%3Aweeks%3A4%3Bnull%3Aweeks%3A3%3Bnull%3Aweeks%3A2%3Bnull%3Aweeks%3A1%3Bnull%3Aweeks%3A0%3B%26&auth=**** HTTP/1.1
Accept: */*
Accept-Language: en-US
Referer: https://www.clarityaccounting.com/app/swf/charts.swf?library_path=https%3A%2F%2Fwww.clarityaccounting.com%2Fapp%2Fswf%2Fcharts_library&xml_s
x-flash-version: 10,0,32,18
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; WOW64; Trident/4.0; SLCC1; .NET CLR 2.0.50727; .NET CLR 3.5.30729; Media Center PC 5.0; .NET CLR 3.0.30729)
Host: www.clarityaccounting.com
Connection: Keep-Alive
Cookie: ****

[/code]

Any idea whether I can increase the maximum size of a header line? I thought that the "large_client_header_buffers 4 8k" directive would do the trick, but that doesn't seem to be the case here.
Re: Error 413 on long query string
January 23, 2010 01:41AM
Sorry, turns out this was an issue in Jetty, not nginx.

Bug is here:

http://jira.codehaus.org/browse/JETTY-336
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 126
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready