魏长东

weichangdong

nginx保存post数据到access日志

user  www www;
worker_processes  4;
worker_cpu_affinity 01 10 01 10;
worker_rlimit_nofile 51200;

error_log  /data/logs/nginx/error.log error;
#error_log  /var/log/nginx/error.log  notice;
#error_log  /var/log/nginx/error.log  info;

pid        /var/run/nginx.pid;

events {
    use epoll;
    worker_connections  51200;
}


http {
    include       /etc/nginx/mime.types;
    default_type  application/octet-stream;
    charset utf-8;

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

    log_format  testlog  '$http_x_forwarded_for - $remote_user [$time_local] '
                          '"$request" $status $body_bytes_sent '
                          '"$http_referer" "$http_user_agent" $request_length $request_time';

    log_format  postlog  '$http_x_forwarded_for $remote_addr "$http_host" [$time_local] '
                          '"$request" $status $body_bytes_sent '
                          '"$http_referer" "$http_user_agent" $request_length $request_time "$request_body"';

    #access_log  /var/log/nginx/access.log  main;
    access_log  /data/logs/nginx/access.log main;

    server_names_hash_bucket_size 128;
    client_header_buffer_size 32k;
    large_client_header_buffers 4 32k;
    client_body_buffer_size 1m;
    client_max_body_size 4m;

    sendfile on;
    tcp_nopush     on;
    keepalive_timeout 60;
    tcp_nodelay on;

    #gzip  on;
    include /etc/nginx/conf.d/*.conf;
}