nginx 1.21 + cgit 0.10 - upstream prematurely closed FastCGI stdout

1.5k views Asked by At

I'm trying to setup cgit 0.10 with nginx and fastcgi. Unfortunately the reponse is a 502. The following message is written in the error.log:

[error] 30956#0: *1 upstream prematurely closed FastCGI stdout while reading response header from upstream, client: **, server: **, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/run/fcgiwrap.socket:", host: "**"</i>

My nginx site is configured as follows:

   server {
      ...
      root /var/www/cgit/;
      proxy_redirect off;

      location ~* ^.+\.(css|png|ico)$ {
          expires 30d;
      }

      location / {
            include fastcgi_params;
            fastcgi_param  SCRIPT_FILENAME  /var/www/cgit;
            fastcgi_pass   unix:/var/run/fcgiwrap.socket;
            fastcgi_param    PATH_INFO $uri;
            fastcgi_param    QUERY_STRING  $args;
      }
}

/var/www/cgit$ ls -al

drwxr-xr-x 2 www-data www-data    4096 Jan 25 22:22 .
drwxr-xr-x 5 www-data www-data    4096 Jan 25 22:21 ..
-rwxr-xr-x 1 www-data www-data 4786733 Jan 25 22:22 cgit.cgi
-rw-r--r-- 1 www-data www-data   12395 Jan 25 22:22 cgit.css
-rw-r--r-- 1 www-data www-data    1488 Jan 25 22:22 cgit.png
-rw-r--r-- 1 www-data www-data    1078 Jan 25 22:22 favicon.ico
-rw-r--r-- 1 www-data www-data      47 Jan 25 22:22 robots.txt

Does anybody have an idea, what is going wrong? I also tried to raise the timeout limit, but I have no success.

Thank you!

1

There are 1 answers

0
snafu On

Ok, I solved my problem. I just updated to the latest fcgiwrap version from the sources. Unfortunately I can't get it to work with the debian package.