agentzh/echo-nginx-module — Issue #8: POST subrequest body doesn't get passed to fastcgi
Author: edo888
Created: 2012-02-26 16:14:40+00:00
State: open

Hi,

Here is my config

location /hello {
default_type text/plain;
echo_subrequest POST '/test' -q 'foo=Foo&bar=baz' -b 'request_body=test&test=3';
}

location /test {
# default example works
#echo "querystring: $query_string";
#echo "method: $echo_request_method";
#echo "body: $echo_request_body";
#echo "content length: $http_content_length";
#echo '///';

fastcgi_pass 127.0.0.1:1234;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME /root/test.php;

#deny all;
}

In test.php file I have this:
On
echo $HTTP_RAW_POST_DATA;
?>

When I make a request with the default example I can see
> curl 'http://localhost/hello'
querystring: foo=Foo&bar=baz
method: POST
body: request_body=test&test=3
content length: 24
///

When I make the same request with fastcgi I can see
> curl 'http://localhost/hello'
Array
(
[foo] => Foo
[bar] => baz
)
Array
(
)

So, as you can see GET params are passed. No request_body or POST params though.

Is this a bug or it is by design?