Gena Makhomed
July 12, 2022 01:56PM
On 12.07.2022 18:40, Maxim Dounin wrote:

> А что у вас по осям? (c)
>
> В смысле - что в log_format? Следом за $status обычно идёт
> $body_bytes_sent, и это размер тела ответа, имеющий приблизительно
> никакого отношения к размеру тела запроса.

На том сервере log_format такой:

log_format frontend '$time_iso8601\t$geoip_country_code\t$remote_addr\t'
'$scheme\t$host\t$request_method\t"$request_uri"\t'
'$status\t$body_bytes_sent\t"$http_referer"\t'
'"$http_user_agent"\t$request_time\t'
'$upstream_response_time';

Очень удобно использовать символ табуляции в качестве разделителя,
логи тогда без проблем читаются в mc и с помощью grep | less -S

Софтом лог с разделителем в виде символа табуляции парсить удобно:
time, geoip_country_code, remote_addr, ... = line.split('\t')

Применяю этот метод в https://github.com/makhomed/autofilter
потому что NGINX App Protect Denial of Service слишком дорого.

Вот еще раз все проверил только что:

# nginx -q -T | grep client_body_buffer_size
client_body_buffer_size 16k;

error.log:

2022/07/12 20:23:26 [warn] 2479#2479: *63684 a client request body is
buffered to a temporary file /var/cache/nginx/client_temp/0000000290,
client: 111.222.33.44, server: sentry.example.com, request: "POST
/api/8/envelope/?sentry_key=xxxxxxxxxx&sentry_version=7 HTTP/2.0", host:
"sentry.example.com", referrer: "https://example.com/"

access.log:

2022-07-12T20:23:26+03:00 XX 111.222.33.44 https
sentry.example.com POST
"/api/8/envelope/?sentry_key=xxxxxxxxxx&sentry_version=7" 200 41
"https://example.com/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64)
AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36"
0.037 0.002

Размер контента - всего 41 байт, что гораздо меньше чем 16 килобайт,
и тем не менее, контент все равно пишется на диск зачем-то.
Как такое может быть?

--
Best regards,
Gena
_______________________________________________
nginx-ru mailing list -- nginx-ru@nginx.org
To unsubscribe send an email to nginx-ru-leave@nginx.org
Subject Author Posted

[warn] a client request body is buffered to a temporary file

Gena Makhomed July 12, 2022 07:44AM

Re: [warn] a client request body is buffered to a temporary file

Maxim Dounin July 12, 2022 11:42AM

Re: [warn] a client request body is buffered to a temporary file

Gena Makhomed July 12, 2022 01:56PM

Re: [warn] a client request body is buffered to a temporary file

Илья Шипицин July 12, 2022 04:00PM

access.log

Gena Makhomed July 13, 2022 04:50AM

Re: access.log

Илья Шипицин July 13, 2022 05:02AM

Re: access.log

Илья Шипицин July 13, 2022 05:10AM

Re: [warn] a client request body is buffered to a temporary file

Maxim Dounin July 12, 2022 04:38PM

Re: [warn] a client request body is buffered to a temporary file

Gena Makhomed July 12, 2022 05:32PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 245
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready