Слишком длинные строки заголовка в error_log

Igor Sysoev is at rambler-co.ru
Thu Jul 21 16:37:36 MSD 2005


On Thu, 21 Jul 2005, Alexey Polyakov wrote:

> Наблюдаю в еррор-логе записи типа:
>
> 2005/07/21 16:12:40 [info] 93339#0: *497465 client sent too long
> header line: "Authorization: Negotiate
> YIIQegYGKwYBBQUCoIIQbjCCEGqhghBmI4IQYgOCBAEAQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFB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QkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJ
>
> В связи с этим вопросы:
> 1) То что в конце ip-адрес врага не выводится - это так и должно быть?
> можно как-то сделать, чтобы выводился?

Прилагаемый патч решает эту проблему.

> 2) Есть ли настройка или простой хак для смены уровня этого события с
> info на warning?

Только хак - в патче нужно изменить NGX_LOG_INFO на NGX_LOG_WARN.


Игорь Сысоев
http://sysoev.ru
-------------- next part --------------
--- src/http/ngx_http_request.c	Tue Jul  5 16:59:18 2005
+++ src/http/ngx_http_request.c	Thu Jul 21 16:33:46 2005
@@ -756,6 +758,14 @@
                 if (rv == NGX_DECLINED) {
                     header.len = r->header_in->end - r->header_name_start;
                     header.data = r->header_name_start;
+
+                    if (header.len > NGX_MAX_ERROR_STR - 50) {
+                        header.len = NGX_MAX_ERROR_STR - 50;
+                        header.data[header.len++] = '.';
+                        header.data[header.len++] = '.';
+                        header.data[header.len++] = '.';
+                    }
+
                     ngx_log_error(NGX_LOG_INFO, c->log, 0,
                                   "client sent too long header line: \"%V\"",
                                   &header);


More information about the nginx-ru mailing list