Welcome! Log In Create A New Profile

Advanced

What is really $request_body variable

Posted by thanatos 
What is really $request_body variable
July 13, 2009 06:37PM
Hi Everyone,,

What is really $request_body variable.

I had try a regex to match a client post body, but it doesn't seem to match anything..
I had added it to the Log file, and it seems to be alway empty.

Someone know something about it ?

Thanks



Edited 2 time(s). Last edit at 07/13/2009 06:46PM by thanatos.
Re: What is really $request_body variable
July 13, 2009 11:41PM
See http://wiki.nginx.org/NginxHttpCoreModule#.24request_body .

You need to be running nginx 0.7.58 or later.

--
Jim Ohlstein
Re: What is really $request_body variable
July 14, 2009 12:54AM
Thanks for your feedback, I got the 0.8.5..

Do you understand what mean "The significance of this variable appears in locations with directives proxy_pass or fastcgi_pass. "

Here for example my configuration :

if ($request_body ~* "notwanted" ) {
return 403;
}

So by my understand, if in the post i got somewhere a string "notwanted" i should get a 403.



Edited 1 time(s). Last edit at 07/14/2009 12:55AM by thanatos.
Re: What is really $request_body variable
July 14, 2009 10:48PM
I would think so (I've never used it) but it would have to look something like:

[code]
location /foo {
fastcgi_pass 127.0.0.1:9000
if ($request_body ~* "notwanted" ) {
return 403;
}
...
}
[/code]

or

[code]
location /foo {
proxy_pass http://127.0.0.1:8080
if ($request_body ~* "notwanted" ) {
return 403;
}
...
}
[/code]

--
Jim Ohlstein
Re: What is really $request_body variable
July 15, 2009 05:30PM
I'm sorry guys, here too it simply doesn't work.

Anyway thanks for trying to help me...anyone got another idea ?

I will try to debug / print this variable....
Re: What is really $request_body variable
July 15, 2009 06:44PM
Sorry but this settings is empty.. I test with a POST ( wich contains Client Body data, so said Wireshark ;)

I had the following

location / {
proxy_pass http://restaunauts;
set $VALUE1 $request_body_file ;
set $VALUE2 $request_body ;
set $VALUE3 $remote_addr ;
}


Debug Gives :


2009/07/16 00:40:07 [debug] 13366#0: *6 http script complex value
2009/07/16 00:40:07 [debug] 13366#0: *6 http script set $value1
2009/07/16 00:40:07 [debug] 13366#0: *6 http script complex value
2009/07/16 00:40:07 [debug] 13366#0: *6 http script set $value2
2009/07/16 00:40:07 [debug] 13366#0: *6 http script complex value
2009/07/16 00:40:07 [debug] 13366#0: *6 http script var: "62.147.181.195"
2009/07/16 00:40:07 [debug] 13366#0: *6 http script set $value3


What is really $client_body ?
Re: What is really $request_body variable
August 04, 2009 08:48PM
HI...

Still nothing...any developpers in the room ;)
Re: What is really $request_body variable
September 30, 2009 05:45AM
i have also got the same problem
Re: What is really $request_body variable
October 23, 2009 06:46AM
same problem — $request_body is empty
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 74
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready