Apache -> Nginx miration problem. Different tcp options?

atlantos nginx-forum at nginx.us
Sun Jun 28 13:42:50 MSD 2009


Problem with HEAD solved by setting fastcgi_ignore_client_abort on

But still getting error on POST. Bellow is code. If $num $num < 853 ( POST length < 1025) everything is ok, if $num >= 853 ( POST length >= 1025) getting error.

use IO::Socket::INET;

my $host = "www.server";
my $num = 853;
my $sock = IO::Socket::INET->new(
PeerAddr => $host,
PeerPort => 'http(80)',
Proto => 'tcp'
);
unless ($sock) { die "cannot connect\n" }
my $string = "POST / HTTP/1.1\r\n";
$string .= "Host: ".$host."\r\n";
$string .= "Accept: */*\r\n";
$string .= "Accept-Encoding: identity\r\n";
$string .= "Connection: close\r\n";
$string .= "Content-Type: application/x-www-form-urlencoded\r\n";
$string .= "Content-Length: ".$num."\r\n\r\n";
for (my $i = 0; $i <$num ; $i++) {
$string .= "x";
}
print $sock $string;
# shutdown call creates problems
# if commented works for nginx and apache
# if uncomented works only with apache
shutdown($sock, 1);
while (my $line = <$sock>) {
print $line if $line =~ /^HTTP.*200 OK/;
}
print "Length: ".length($string)."\n";
close $sock;

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,3492,3497#msg-3497






More information about the nginx mailing list