Re: Очень длинные урлы.
Igor Sysoev
igor на sysoev.ru
Чт Дек 29 08:16:01 UTC 2011
On Thu, Dec 29, 2011 at 11:16:50AM +0400, Михаил Монашёв wrote:
> Здравствуйте, Igor.
>
> >> Можно как-то ограничить в nginx-е длину url-ей , передаваемых на
> >> бэкенд? А то апач выдаёт 403 на длинные урлы
> >> [Wed Dec 28 22:47:07 2011] [error] [client 81.200.127.6]
> >> (63)File name too long: access to
> >> /interests/%2e%2e%2e%2e%2e%2e%2e%2e%2e%2e%2e%2e%2e%2e%2e%2e%2e%2e%2e%2e%2e%2e%2e%2e%2e%2e%2e%2e%2e%2e%2e%2e%2e%2e%2e%2e%2e%2e%2e%2e%2e%2e%2e%2e%2e%2e%2e%2e%2e%2e%2e%2e%2e%2e%2e%2e%2e%2e%2e%2e%2e%2e%2e%2e%2e%2e%2e%2e%2e%2e%2e%2e%2e%2e%2e%2e%2e%2e\xc8\xd5
> >> \xce\xd7\xc5\xcd\xdc
> >> \xcc\xcd\xce\xc3\xce%2e%2e%2e%2e%2e%2e%2e%2e%2e%2e%2e%2e%2e%2e%2e%2e%2e%2e%2e%2e%2e%2e%2e%2e%2e%2e%2e%2e%2e%2e%2e%2e%2e%2e%2e%2e%2e%2e%2e%2e%2e%2e%2e%2e%2e%2e%2e%2e%2e%2e%2e%2e%2e%2e%2e%2e%2e%2e%2e%2e%2e%2e%2e%2e%2e%2e%2e%2e%2e%2e%2e%2e%2e%2e%2e/
> >> failed
> >> и я не знаю как изменить его поведение, например, на выдачу редиректа
> >> на /interests/ или на / . Ну или может в апаче 1.3 есть способ, как
> >> управлять ответом на длинные урлы.
>
> > location ~ ^/.{1024,} {
> > return http://$host/;
> > }
>
> Спасибо.
> А апач 1.3 имеет ограничение в 1024 символов в урле?
Нет, у него 8K. "File name too long" - это ошибка ядра.
> Приведённый выше
> урл короче 1024 символов.
[ENAMETOOLONG] A component of a pathname exceeded 255 characters, or
an entire path name exceeded 1023 characters.
location ~ ^/.{1024,} {
return http://$host/;
}
location ~ /[^/]{256,}/ {
return http://$host/;
}
--
Igor Sysoev
Подробная информация о списке рассылки nginx-ru