sub_filter режет половину страницы

dewil dewil.ru at gmail.com
Mon Sep 10 20:03:26 MSD 2007


Добрый день.

Просьба к Игорю, прокоментировать поведение.

Браузером страница открывается полностью (16880 byte).
Если ее прочитать скриптом, например на php или просто загрузить через
wget, то тело получается обрезанным (11915 byte), а в error.log пишет
следующее:

2007/09/10 19:44:07 [alert] 76652#0: *523892 zero size buf in writer
t:0 r:0 f:0 00000000 081ADB90-081ADB90 00000000 0-0 while sending to
client, client: x.x.x.x, server: x.com, URL: "/Pages/rus/news.php",
upstream: "http://127.0.0.1:80/Pages/rus/news.php", host: "x.com"

Было выявлено, что обрезание пропадает, если убрать конструкцию sub_filter
Вот как выглядит location:

        location ~* \.php$ {
            proxy_pass          http://127.0.0.1:80;
            proxy_set_header    Host            $host;
            proxy_set_header    X-Forwarded-For $remote_addr;
            sub_filter          '</body></html>' '';
            sub_filter_once   off;
        }

Пробовал добавлять
proxy_set_header Accept-Encoding "";
Одинаково.

Комбинация </body></html> в теле страницы присутсвутет в одном
экземпляре в самом конце.
Куда копать?

FreeBSD 6.2-RELEASE-p3
nginx version: nginx/0.5.31 (из портов)
configure arguments: --with-http_sub_module
--prefix=/usr/local/etc/nginx --with-cc-opt=-I /usr/local/include
--with-ld-opt=-L /usr/local/lib
--conf-path=/usr/local/etc/nginx/nginx.conf
--sbin-path=/usr/local/sbin/nginx --pid-path=/var/run/nginx.pid
--http-client-body-temp-path=/var/tmp/nginx/client_body_temp
--http-proxy-temp-path=/var/tmp/nginx/proxy_temp
--http-fastcgi-temp-path=/var/tmp/nginx/fastcgi_temp
--http-log-path=/var/log/nginx-access.log
--error-log-path=/var/log/nginx-error.log
--with-http_stub_status_module --user=www --group=www --with-debug
--with-http_ssl_module --with-http_addition_module

--
dwl


More information about the nginx-ru mailing list