Welcome! Log In Create A New Profile

Advanced

Receiving 413- Entity Request Too Large when limiting rate

Posted by alexbatt 
Receiving 413- Entity Request Too Large when limiting rate
June 25, 2020 03:33AM
Hi Nginx Gurus,
I'm trying the to limit the messages received for a specific location, but when the rate in which the messages are sent is exceeding the defined rate in the nginx.conf, I'm getting ,413- Entity Request Too Large, errors and not only 503 warnings as defined in the documentation.
I'm using Jmeter to send the messages to a server. When the sending rate less then or equals the defined rate in the nginx.conf everything works fine.

Configurations:
nginx/1.13.8
nginx running inside docker on rhel

nginx.conf:
http {
limit_req_zone $binary_remote_addr zone=myLimit:10m rate=45r/m;
server {
location /my_endpoint {
limit_req zone=myLimitburst=5 nodelay;
client_max_body_size 15m;
}

I've also tried to set the client_max_body_size to 0, move it on the server level , add client_body_buffer_size 128k; same result.

logs:
nginx_access.log
10.128.40.18 - - [24/Jun/2020:09:55:01 +0300] "POST /my_endpoint HTTP/1.1" 413 199 "-" "Apache-HttpClient/4.5.5 (Java/1.8.0_51)" "11.111.111.111"
error_logs:
2020/06/24 09:55:00 [error] 25#25: *2140 client intended to send too large body: 1101464 bytes, client: 00.00.00.000 server: localhost, request: "POST /my_endpoint HTTP/1.1", host: "11.11.11.11.11"

i'm also getting 503, which is as expected.

I've also connected Fiddler to follow the request/responses, for basically the same request I'm getting 202 and 413 response,
screenshots attached.

Appreciate your help,

Best Regards,
Alex
Attachments:
open | download - fiddler-413-response.png (67 KB)
open | download - fiddler-ok-response.png (68 KB)
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 81
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready