Как побороть "upstream sent unsupported FastCGI protocol version"

Alexander Pashchenko point212 at gmail.com
Sun Mar 8 18:25:13 MSK 2009


День добрый. Дали мне тут настроить одну онлайн-игрушку.
У ней самописный сервер fastcgi (некий демон на C++).
Раньше работало с nginx 0.3.54 под FreeBSD.

Сейчас скомпилял под Fedora 10. Все удачно. Висит, слушает порт. Nginx
поставил 0.6.34 из репозитория федоры.

Одна беда: при обращении к демону вылазит 502я ошибка, а в логах вот это:
2009/03/08 17:58:51 [error] 32151#0: *5 upstream sent unsupported FastCGI
protocol version: 72 while reading response header from upstream, client:
xx.xx.xx.xx, server: nx.melan, request: "GET / HTTP/1.1", upstream:
"fastcgi://127.0.0.1:9000", host: "nx.melan"

Уже даже исходники ковырять начал... но поскольку не программист - мало что
получается.
Пробовал скачать с sysoev.ru версию 0.3.54 - не собирается.

В общем остановился на варианте - разобраться с этой.
Может быть подскажите, почему может возникать эта ошибка? Можен из демона
должен прийти какой-то хэдер с версией протокола, или что? Или где-то в
конфигах nginx надо поставить некую директиву?

Дополнительное инфо.
Телнет к демону на порт:
[root at localhost chat]# telnet 127.0.0.1 9000
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
HTTP/1.0 200 Ok Welcome to VOC
Server: VOC++ Voodoo chat Extension daemon ver cpp, modified by A!e% Babaev
Content-type: text/html
Expires: Mon, 08 Apr 1976 19:30:00 GMT+3
Connection: close
Keep-Alive: max=0
Cache-Control: no-store, no-cache, must-revalidate
Cache-Control: post-check=0, pre-check=0
Pragma: no-cache

sorry, too long connecton attempt
Connection closed by foreign host.

Вот конфиг nginx:

#user  nobody;
worker_processes  1;

#error_log  logs/error.log;
#error_log  logs/error.log  notice;
#error_log  logs/error.log  info;

#pid        logs/nginx.pid;


events {
    worker_connections  1024;
}


http {
    include       mime.types;
    default_type  application/octet-stream;

    #log_format  main  '$remote_addr - $remote_user [$time_local] $status '
    #                  '"$request" $body_bytes_sent "$http_referer" '
    #                  '"$http_user_agent" "$http_x_forwarded_for"';

    #access_log  logs/access.log  main;

    sendfile        on;
    #tcp_nopush     on;

    #keepalive_timeout  0;
    keepalive_timeout  65;
    tcp_nodelay        on;

    #gzip  on;

    server {
        listen       80;
        server_name nx.melan;

        #charset koi8-r;


        location / {
            root   /var/www;
            index  index.html index.htm index.php;
        }

        #error_page  404              /404.html;

        # redirect server error pages to the static page /50x.html
        #
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }

        location ~ \.php$ {
            fastcgi_pass   127.0.0.1:9000;
          #  fastcgi_pass unix:/tmp/php-fastcgi.sock;
            fastcgi_index  index.php;
            fastcgi_param  SCRIPT_FILENAME  /var/www$fastcgi_script_name;
            fastcgi_param  QUERY_STRING     $query_string;
            fastcgi_param  REQUEST_METHOD   $request_method;
            fastcgi_param  CONTENT_TYPE     $content_type;
            fastcgi_param  CONTENT_LENGTH   $content_length;
            fastcgi_param  REMOTE_ADDR      $remote_addr;
            fastcgi_param  SERVER_PORT      $server_port;
            fastcgi_param  REDIRECT_STATUS  200;
            fastcgi_param  SCRIPT_NAME      $fastcgi_script_name;
        }
        location /ch {
           proxy_pass http://127.0.0.1:8001;
           proxy_read_timeout 9999;
           proxy_buffering off;

        }

        # deny access to .htaccess files, if Apache's document root
        # concurs with nginx's one
        #
        location ~ /\.ht {
            deny  all;
        }
   }

    server {
        listen      80;
        server_name  nx.melan/news;

        location / {
            root   /var/www/news;
            index  index.html index.htm index.php;
        }

        location ~ \.php$ {
            fastcgi_pass   127.0.0.1:9000;
            fastcgi_index  index.php;
            fastcgi_param  SCRIPT_FILENAME
 /var/www/news$fastcgi_script_name;
            fastcgi_param  QUERY_STRING     $query_string;
            fastcgi_param  REQUEST_METHOD   $request_method;
            fastcgi_param  CONTENT_TYPE     $content_type;
            fastcgi_param  CONTENT_LENGTH   $content_length;
            fastcgi_param  REMOTE_ADDR      $remote_addr;
            fastcgi_param  SERVER_PORT      $server_port;
            fastcgi_param  REDIRECT_STATUS  200;
            fastcgi_param  SCRIPT_NAME      $fastcgi_script_name;
        }

        location ~ /\.ht {
            deny  all;
        }
   }
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://nginx.org/pipermail/nginx-ru/attachments/20090308/9edd11a0/attachment.html>


More information about the nginx-ru mailing list