# 调用链跟踪配置
# load_module /usr/local/lib/ngx_http_opentracing_module.so;

# nginx Brotli
load_module /usr/local/nginx/modules/ngx_http_brotli_filter_module.so;
load_module /usr/local/nginx/modules/ngx_http_brotli_static_module.so;

user  nginx nginx;
worker_processes  2;

worker_rlimit_nofile 65535;
worker_shutdown_timeout 5s;

events {
    use epoll;
    worker_connections  10240;
}


http {


    # 设置真实 IP 地址的来源头部
    real_ip_header X-Forwarded-For;


    include       mime.types;
    default_type  application/octet-stream;

    log_format main '$remote_addr - - [$time_local] "$request" $status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" [$request_time, $upstream_response_time] $host ($remote_port) $scheme '
                      '[$upstream_addr,$upstream_connect_time,$upstream_status] "sid=$cookie_sessionid" "request_id=$request_id"';
    access_log  logs/access.log  main;

    server_tokens off;
    sendfile        on;
    tcp_nodelay     on;

    lingering_close off;
    keepalive_timeout 5;
    send_timeout 60;
    proxy_headers_hash_max_size 51200;
    proxy_headers_hash_bucket_size 6400;
    proxy_connect_timeout 60;
    proxy_read_timeout 60;
    proxy_send_timeout 60;
    #proxy_ignore_client_abort on;

    # 最大上传包
    client_max_body_size 70m;
    charset utf-8;

    # nginx Brotli
    brotli on;
    brotli_comp_level 6;
    brotli_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript application/javascript image/svg+xml;

    ## GZIP Setting
    gzip  on;
    gzip_min_length  1000;
    gzip_buffers     4 8k;
    gzip_http_version  1.0;
    gzip_comp_level  5;
    gzip_types       text/plain text/css application/x-javascript application/json application/xml;
    proxy_http_version 1.1;


    include /usr/local/nginx/conf/servers/*/upstream.conf;
    include /usr/local/nginx/conf/servers/*/site.conf;

}



