Hi!
I'm trying to use nginx in a looking glass (traceroute, ping) application requiring use of
non-parsed headers (nph) - but can't get it to work.
Using strace and enabling debug error.log I see that nginx are receiving all the headers
from the fastcgi server. But nginx does not write the header further to the client.
What am I missing? Does anybody have any working examples?
Kind regards,
Ole Bjørn Hessen.
I'm using fastcgi module like this:
location /cgi-bin {
fastcgi_pass 127.0.0.1:7123;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
include fastcgi_params;
}
The fast cgi server below.
#!/usr/bin/perl
use FCGI;
use CGI;
my $q = CGI->new;
my $count = 0;
my $socket = FCGI::OpenSocket( "127.0.0.1:7123", 10 );
my $request = FCGI::Request( \*STDIN, \*STDOUT, \*STDERR, \%req_params, $socket );
while($request->Accept() >= 0)
{
$| = 1;
print $q->header(-nph => 1);
print "<pre>\n";
for (my $i = 0; $i <= 10; $i++) {
print "hei ", scalar(localtime(time)), " $count\n";
$request->Flush();
sleep(1);
}
print "</pre>\n";
$count++;
}