nginx / fcgiwrapper错误“无法获取脚本名称,......”

时间:2013-01-13 15:30:02

标签: nginx fastcgi otrs

我试图用nginx和fcgiwrap在Debian上运行OTRS。但我得到的只是这个错误:

FastCGI sent in stderr: "Cannot get script name, is DOCUMENT_ROOT and SCRIPT_NAME set 
and is the script executable?" while reading response header from upstream, 
client: 123.123.123.123, 
server: support.example.com, 
request: "GET /otrs/index.pl HTTP/1.1", 
upstream: "fastcgi://unix:/var/www/sockets/fcgiwrap.socket:", 
host: "support.example.com", referrer: "http://support.examle.com/"

这是我的配置:

server {
    server_name support.example.com;

    access_log      /var/www/support/log/access.log;
    access_log      /var/log/nginx/access.log;
    error_log       /var/www/support/log/error.log info;

    fastcgi_buffers 8 16k;
    fastcgi_buffer_size 32k;

    root /var/www/support/otrs/var/httpd/htdocs;

    index index.html;

    location = /favicon.ico {
            access_log      off;
            log_not_found   off;
    }

    location /otrs-web/ {
            alias /var/www/support/otrs/var/httpd/htdocs;
    }

    location ~ ^/otrs/(.*\.pl)(/.*)?$ {
            gzip off;

            fastcgi_pass unix:/var/www/sockets/fcgiwrap.socket;

            fastcgi_index index.pl;

            fastcgi_param SCRIPT_FILENAME /var/www/support/otrs/bin/fcgi-bin/$1;

            include fastcgi_params;

    }
}

和fastcgi_params:

fastcgi_connect_timeout 65;
fastcgi_send_timeout    180;
fastcgi_read_timeout    180;

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   SCRIPT_FILENAME         $request_filename;
fastcgi_param   SCRIPT_NAME             $fastcgi_script_name;
fastcgi_param   REQUEST_URI             $request_uri;
fastcgi_param   DOCUMENT_URI            $document_uri;
fastcgi_param   DOCUMENT_ROOT           $document_root;
fastcgi_param   SERVER_PROTOCOL         $server_protocol;

fastcgi_param   GATEWAY_INTERFACE       CGI/1.1;
fastcgi_param   SERVER_SOFTWARE         nginx/$nginx_version;

fastcgi_param   REMOTE_ADDR             $remote_addr;
fastcgi_param   REMOTE_PORT             $remote_port;
fastcgi_param   SERVER_ADDR             $server_addr;
fastcgi_param   SERVER_PORT             $server_port;
fastcgi_param   SERVER_NAME             $server_name;

fastcgi_param   HTTPS                   $https;

# PHP only, required if PHP was built with --enable-force-cgi-redirect
fastcgi_param   REDIRECT_STATUS         200;

1 个答案:

答案 0 :(得分:0)

这可能是debian squeeze(1.0-1 + squeeze1)上发现的fcgiwrap版本的错误。见http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=698071

升级到fcgiwrap 1.0.3-3为我解决了这个问题。