I'm using NGINX to call another apache/PHP service. Following is my NGINX code,
location /hello {
content_by_lua_block {
res = ngx.location.capture("/forward2");
ngx.say("status: " .. res.status);
ngx.say("result: " .. res.body);
}
}
location /forward2{
proxy_pass http://127.0.0.1:2002/index2.php;
}
I have a very simple php code,
<?php
echo "123456789";
echo "123456789";
echo "123456789";
echo "123456789";
echo "123456789";
echo "123456789";
My problem is whever I exceed the number of output characters in php
sctpt more than 65 characters I get following strange output for body
status: 200 result: ‹30426153·°4Ò,@£)AÈ
If i have less output characters in PHP code then I get correct
output as following, (in following case only three php echo lines)
status: 200 result: 0123456789012345678901234567890123456789
Do you have any idea about why this is happennning?
Note: If i access to php directly (Not via NGINX), I always get correct output for any number of characters.