CGI scripts worked perfectly, while I was using HTTP. Then I set redirecting for all traffic through https and now CGI doesn't work at all (404 - not found). I use lighttpd server.
Here is the part of lighttpd.conf for redirect:
$SERVER["socket"] == ":80" { $HTTP["host"] =~ "(.*)" { url.redirect = ( "^/(.*)" => "https://%1/$1" ) } } EDIT 1: lighttpd.conf (click me)
EDIT 2: mod_fastcgi.conf (click me)