Welcome! Log In Create A New Profile

Advanced

$request_body bug?

October 05, 2009 07:16AM
<77c05b2d06761837dd2152a37d2f66dc.NginxMailingListEnglish@forum.nginx.org>
Content-Type: text/plain; charset="big5"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0


Dear all:

When I use this variable in log_format directive ,it can print the request_body in the log file

but somewhere else it can't!

if i use the $request_body at log_format and somewhere else( such as "proxy_pass") at the same time .there is no output in the log file!

http{

log_format main '$remote_addr - $remote_user [$time_local] $request '
'"$status" $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for" "$request_body"';


server {
listen 80;
server_name my.test.com;
root /opt/test;
include vhost/alias.conf;
include vhost/proxy.conf;
if (-d $request_filename) {
rewrite ^/(.*)([^/])$ http://$host/$1$2/ permanent;
}
set $mytest $request_body;
log_format test '$remote_addr - $remote_user [$time_local] $request '
'"$status" $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for" "$mytest"';
location / {
root /opt/test;
index index.html index.htm;
}
error_log /usr/local/nginx/logs/my_error.log;
access_log /usr/local/nginx/logs/my_access.log main;
include vhost/prox.conf;
}
}
}


My Nginx Version is
nginx version: nginx/0.8.15
_________________________________________________________________
Subject Author Posted

FCGI Perl

Gordon Pettey October 02, 2009 05:52PM

Re: FCGI Perl

Cliff Wells October 02, 2009 06:06PM

Re: FCGI Perl

Gordon Pettey October 02, 2009 07:58PM

Re: FCGI Perl

mike October 02, 2009 08:12PM

Re: FCGI Perl

Gordon Pettey October 03, 2009 12:42PM

Re: FCGI Perl

davidc October 05, 2009 05:25AM

$request_body bug?

dennisjanuary October 05, 2009 07:16AM

Re: FCGI Perl

Johnny fox Ucklenberg October 16, 2009 07:04PM

Re: FCGI Perl

Aleksandar Lazic October 16, 2009 07:14PM

Re: FCGI Perl

Kiswono Prayogo October 17, 2009 04:26AM

Re: FCGI Perl

Cliff Wells October 17, 2009 05:32AM

Re: FCGI Perl

Aleksandar Lazic October 17, 2009 06:50AM

Re: FCGI Perl

Johnny fox Ucklenberg October 17, 2009 11:54AM

Re: FCGI Perl

Aleksandar Lazic October 17, 2009 12:16PM

Re: FCGI Perl

Johnny Fox Ucklenberg October 17, 2009 02:20PM

Re: FCGI Perl

Aleksandar Lazic October 17, 2009 04:44PM

Re: FCGI Perl

Johnny Fox Ucklenberg October 17, 2009 06:22PM

Re: $request_body bug?

agentzh October 22, 2009 04:02AM

Re: $request_body bug?

agentzh October 22, 2009 09:50PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 186
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready