Skip to content

POST subrequest body doesn't get passed to fastcgi #8

@edo888

Description

@edo888

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.

I expect it to output:
Array
(
[foo] => Foo
[bar] => baz
)
Array
(
[request_body] => test
[test] => 3
)
request_body=test&test=3

Is this a bug or it is by design?

I'm using v0.37 which comes with nginx 1.1.13.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions