Welcome! Log In Create A New Profile

Advanced

How to nph (non parsed headers) with nginx ?

Posted by obh 
obh
How to nph (non parsed headers) with nginx ?
October 29, 2009 09:44AM
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++;
}
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 120
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready