Nginx输出请求内容

对特定请求路径输出请求内容  例:对/api/log/print 请求日志输出

修改配置文件nginx.conf

http {

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

    server {
        listen       8443 ssl;
        listen       [::]:8443;
        server_name  127.0.0.1;

        location  /api/log/print{
            access_log  logs/virus.log  main;
        }
    }   
}

 

你可能感兴趣的:(Linux,nginx,日志,请求日志)