ПРОЕКТЫ 


  АРХИВ 


Apache-Talk @lexa.ru 

Inet-Admins @info.east.ru 

Filmscanners @halftone.co.uk 

Security-alerts @yandex-team.ru 

nginx-ru @sysoev.ru 


  СТАТЬИ 


  ПЕРСОНАЛЬНОЕ 


  ПРОГРАММЫ 



ПИШИТЕ
ПИСЬМА












     АРХИВ :: nginx-ru
Nginx-ru mailing list archive (nginx-ru@sysoev.ru)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Проблема с curl, proxy cache и Content-Lenght


  • To: nginx-ru@xxxxxxxxx
  • Subject: Проблема с curl, proxy cache и Content-Lenght
  • From: "ddr400" <nginx-forum@xxxxxxxx>
  • Date: Wed, 05 Mar 2014 07:44:11 -0500
  • Dkim-signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=selenium.jlkhosting.com; s=x; h=Date:Sender:From:Message-ID:Content-Transfer-Encoding:Content-Type:Subject:To; bh=/bSjkxwO0VB6AyQGR0vr5yb1LkYup7RJ3fDT8SZ6XCE=; b=g6Mki/bo8rjVeBQ7mfoPgeO+3EF44PKi7ml4MULa93kI0cVbLtXkNRmclD/5oAJIlW/SI9pnpxBLVpZ6+Po/fDU3cxki25bc9BxGJtLosYVLQwolPCG6uq8gCKA9cHWLElT6G2MWAA5ISDoAgdnV7CxGyP4EV6EDeZMh/6Zp2Kc=;

Всем привет!

Столкнулся с неожиданной проблемой. Если включен proxy_cache и используется
ssi, curl часто выдает ошибку

* Received problem 3 in the chunky parser
* Closing connection #0
curl: (56) Received problem 3 in the chunky parser

и в error.log:

2014/03/05 16:33:55 [info] 31373#0: *525 client prematurely closed
connection while sending to client, client: 1.1.1.1, server: host.ru,
request: "GET / HTTP/1.1", subrequest: "/includes/lists/tabloid", upstream:
"http://127.0.0.1:9030/includes/lists/tabloid";, host: "host.ru"

Все начинает правильно работать, при следующих условиях:

1. ssi off и тогда nginx начинает передавать curl заголовок Content-Lenght
2. proxy_cache не используется и ssi on

Конфиг:

        ssi on;

        gzip_static on;

        keepalive_requests 20;
        location ~ ^/includes {

                include /etc/nginx/conf/access.conf;

                proxy_cache some-cache;
                proxy_cache_valid 200 302 301 304 10s;
                proxy_cache_key "$request_method|$host|$uri";
                proxy_hide_header "Set-Cookie";
                proxy_ignore_headers "Cache-Control" "Expires";
                proxy_cache_use_stale error timeout invalid_header updating
http_500 http_502 http_503;
                proxy_cache_lock on;

                proxy_http_version 1.1;

                proxy_set_header        X-Real-IP       $remote_addr;
                proxy_set_header        X-Forwarded-For
$proxy_add_x_forwarded_for;

                proxy_set_header        Accept          text/html;
                proxy_set_header        Host            host.ru;

                proxy_pass      http://localhost:9030;


        }

        location / {

                proxy_cache some-cache;
                proxy_cache_valid 200 302 301 304 30s;
                proxy_cache_key "$request_method|$host|$uri";
                proxy_hide_header "Set-Cookie";
                proxy_ignore_headers "Cache-Control" "Expires";
                proxy_cache_use_stale error timeout invalid_header updating
http_500 http_502 http_503;
                proxy_cache_lock on;

                proxy_http_version 1.1;

                proxy_set_header        X-Real-IP       $remote_addr;
                proxy_set_header        X-Forwarded-For
$proxy_add_x_forwarded_for;

                proxy_set_header        Accept          text/html;
                proxy_set_header        Host            host.ru;

                proxy_pass      http://localhost:9030;
        }

Заголовки приложения:

< HTTP/1.1 200 OK
< Date: Wed, 05 Mar 2014 12:38:37 GMT
< Status: 200 OK
< Connection: close
< Content-Type: text/html; charset=utf-8
< Content-Length: 20041
< X-UA-Compatible: IE=Edge,chrome=1
< ETag: "8bdee631c5839fef72100f192025570b"
< Cache-Control: max-age=0, private, must-revalidate
< X-Request-Id: bd50bffa8386d8c870448d47f2f00941
< X-Runtime: 0.116565

Заголовки которые отдает nginx:

< HTTP/1.1 200 OK
< Server: nginx
< Date: Wed, 05 Mar 2014 12:38:11 GMT
< Content-Type: text/html; charset=utf-8
< Transfer-Encoding: chunked
< Connection: keep-alive
< Vary: Accept-Encoding
< Status: 200 OK
< X-UA-Compatible: IE=Edge,chrome=1
< Cache-Control: max-age=0, private, must-revalidate
< X-Request-Id: 5238e092ddcf2a4b83e527fda2892145
< X-Runtime: 0.098263

Posted at Nginx Forum: 
http://forum.nginx.org/read.php?21,248133,248133#msg-248133

_______________________________________________
nginx-ru mailing list
nginx-ru@xxxxxxxxx
http://mailman.nginx.org/mailman/listinfo/nginx-ru


 




Copyright © Lexa Software, 1996-2009.