$request_body bug?

dennis cao dennis__cao at hotmail.com
Mon Oct 5 15:08:29 MSD 2009


 <77c05b2d06761837dd2152a37d2f66dc.NginxMailingListEnglish at 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 		 	   		  
_________________________________________________________________
¤U¸ü Windows Live Messenger 9.0¡A¦h¤¸·¾³q¡BºÉ±¡¤À¨É¡A©M§Y®É¶Ç°T¦n¤Í½u¤W¦P¼Ö¡I¡X ¥ß§Y¤U¸ü
http://download.live.com/messenger





More information about the nginx mailing list