user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log;
pid /run/nginx.pid;
worker_rlimit_nofile 65535;
# Load dynamic modules. See /usr/share/doc/nginx/README.dynamic.
include /usr/share/nginx/modules/*.conf;

events {
    worker_connections 65535;
}

http {
    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '

    access_log  /var/log/nginx/access.log  main;
    #set_real_ip_from 192.168.0.218;
    #real_ip_header X-Forwarded-For;
    #real_ip_recursive on;

    sendfile            on;
    tcp_nopush          on;
    tcp_nodelay         on;
    keepalive_timeout   100;
    types_hash_max_size 4096;
    # 保存服务器名字的hash表大小配置
    # server_names_hash_bucket_size 96;
    # server_names_hash_max_size 512;

    server_names_hash_bucket_size 96;
    server_names_hash_max_size 512;

    include             /etc/nginx/mime.types;
    default_type        application/octet-stream;
    server_tokens off;
    # 开启缓存
    # proxy_cache_path /nginx_cache/to/cache levels=1:2 keys_zone=my_cache:10m max_size=10g inactive=60m use_temp_path=off;

    gzip on;
    gzip_min_length 2k;
    gzip_buffers 4 32k;
    gzip_http_version 1.1;
    gzip_comp_level 6;
    gzip_types text/plain text/css text/javascriptapplication/json application/javascript application/x-javascriptapplication/xml;
    gzip_vary on;
    gzip_static on;
    gzip_proxied any;

    include /etc/nginx/conf.d/*.conf;
}