Welcome! Log In Create A New Profile

Advanced

nginx и ntop

Dmitry Ivanov
April 08, 2011 06:02AM
Здравствуйте, All.

Решил перед веб-интерфейсом ntop поставить nginx

nginx version: nginx/0.8.54

location /ntop {
proxy_pass http://127.0.0.1:3000;
proxy_set_header Host $http_host;
proxy_intercept_errors on;
chunked_transfer_encoding off;
}

ntop, как известно, разговаривает на HTTP 1.0

В итоге получаю:

# wget --spider -S 127.0.0.1:3000
Spider mode enabled. Check if remote file exists.
--2011-04-08 13:52:50-- http://127.0.0.1:3000/
Connecting to 127.0.0.1:3000... connected.
HTTP request sent, awaiting response...
HTTP/1.0 501 Not Implemented
Date: Fri, 08 Apr 2011 09:52:49 GMT
Cache-Control: no-cache
Expires: 0
Connection: close
Server: ntop/4.0.1/32-bit (i386-8.2-RELEASE-freebsd8.2)
Content-Type: text/html
--2011-04-08 13:52:51-- (try: 2) http://127.0.0.1:3000/
Connecting to 127.0.0.1:3000... connected.
HTTP request sent, awaiting response...
HTTP/1.0 200 OK
Date: Fri, 08 Apr 2011 09:52:51 GMT
Cache-Control: no-cache
Expires: 0
Connection: close
Server: ntop/4.0.1/32-bit (i386-8.2-RELEASE-freebsd8.2)
Content-Type: text/html
Length: unspecified [text/html]
Saving to: `index.html'
2011-04-08 13:52:56 (9.25 KB/s) - `index.html' saved [43200]

Тут wget, получив HTTP/1.0 501 Not Implemented, делает новый запрос
уже по 1.0 и все ОК.

Далее:

# wget --spider -S firma.ru/ntop
Spider mode enabled. Check if remote file exists.
--2011-04-08 13:52:33-- http://firma.ru/ntop
Resolving firma.ru (firma.ru)... 81.19.75.176
Connecting to firma.ru (firma.ru)|81.19.75.176|:80... connected.
HTTP request sent, awaiting response...
HTTP/1.1 501 Not Implemented
Server: nginx/0.8.54
Date: Fri, 08 Apr 2011 09:52:34 GMT
Content-Type: text/html
Connection: keep-alive
Cache-Control: no-cache
Expires: 0
--2011-04-08 13:52:35-- (try: 2) http://firma.ru/ntop
Connecting to firma.ru (firma.ru)|81.19.75.176|:80... connected.
HTTP request sent, awaiting response...
HTTP/1.1 502 Bad Gateway
Server: nginx/0.8.54
Date: Fri, 08 Apr 2011 09:52:35 GMT
Content-Type: text/html
Content-Length: 173
Connection: keep-alive
Remote file does not exist -- broken link!!!

Т.е. nginx возвращает 501 от бэкенда в HTTP 1.1, еще один запрос и в
логах

upstream prematurely closed connection while reading response header from upstream

Как подружить nginx и бэкенд, работающий только по HTTP 1.0?

Спасибо.

--
С уважением,
Dmitry


_______________________________________________
nginx-ru mailing list
nginx-ru@nginx.org
http://nginx.org/mailman/listinfo/nginx-ru
Subject Author Posted

nginx и ntop

Dmitry Ivanov April 08, 2011 06:02AM

Re: nginx и ntop

Igor Sysoev April 11, 2011 05:46AM

Re[2]: nginx и ntop

Dmitry Ivanov April 11, 2011 06:22AM

Re: nginx и ntop

Igor Sysoev April 11, 2011 11:54AM

Re[2]: nginx и ntop

Dmitry Ivanov April 11, 2011 01:46PM

Re: nginx и ntop

Igor Sysoev April 11, 2011 01:58PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 147
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready