Welcome! Log In Create A New Profile

Advanced

Как отдавать клиенту Content-Length от FastCGI приложения?

June 18, 2011 02:58PM
Всем привет!

Nginx работает в качестве единственного веб-сервера, подключается к FastCGI приложению:

location /cgi-bin/ {
ssi on;
fastcgi_pass 192.168.0.2:9000;
fastcgi_intercept_errors on;
include fastcgi_params;
}

Есть запрос, для которого FastCGI приложение отправляет в ответе хидер Content-Length.

Сейчас Nginx передает клиенту ответ через Transfer-Encoding: chunked для HTTP/1.1, где Content-Length не может использоваться. А для HTTP/1.0 не передает клиенту этот хидер вовсе.

----- HTTP/1.1 -----

# telnet 192.168.0.1 80
Trying 192.168.0.1...
Connected to 192.168.0.1.
Escape character is '^]'.
GET /cgi-bin/update.cgi?version=8099 HTTP/1.1
Host: mydomain.com

HTTP/1.1 200 OK
Server: nginx/0.7.65
Date: Sat, 18 Jun 2011 18:49:38 GMT
Content-Type: text/html
Transfer-Encoding: chunked
Connection: close

5
NONEW
0

Connection closed by foreign host.

----- HTTP/1.0 -----

# telnet 192.168.0.1 80
Trying 192.168.0.1...
Connected to 192.168.0.1.
Escape character is '^]'.
GET /cgi-bin/update.cgi?version=8099 HTTP/1.0
Host: mydomain.com

HTTP/1.1 200 OK
Server: nginx/0.7.65
Date: Sat, 18 Jun 2011 18:33:30 GMT
Content-Type: text/html
Connection: close

NONEWConnection closed by foreign host.

--------------------

Каким путем можно заставить Nginx отправлять Content-Length для запроса /cgi-bin/update.cgi?version=8099 ?

Спасибо.
Subject Author Posted

Как отдавать клиенту Content-Length от FastCGI приложения?

roru June 18, 2011 02:58PM

Re: Как отдавать клиенту Content-Length от FastCGI приложения?

Maxim Dounin June 18, 2011 06:00PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 210
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