user  root;
worker_processes  auto;
 
#error_log  logs/error.log;
#error_log  logs/error.log  notice;
#error_log  logs/error.log  info;
 
#pid        logs/nginx.pid;
 
events {
    worker_connections  1024;
}
 
http {
    variables_hash_max_size 4096;  
    variables_hash_bucket_size 128;
    include       mime.types;
    default_type  application/octet-stream;
 
    #log_format  main  ' -  [] "" '
    #                  '  "" '
    #                  '"" ""';
 
    #access_log  logs/access.log  main;
 
    sendfile        on;
    #tcp_nopush     on;
 
    #keepalive_timeout  0;
    keepalive_timeout  65;

    #ADD lua path
    lua_package_path "${prefix}/lualib/?.lua;/usr/local/openresty/lualib/?.lua";
 
    #gzip  on;
    vhost_traffic_status_zone;
     
    server_tokens off;
    #访问地理位置限制规则
    geoip2 /usr/share/GeoIP/GeoLite2-Country.mmdb {
        $geoip2_data_country_code default=default source=$remote_addr country iso_code;
    }
    #处理HTTP/1.1中的WebSocket升级请求
    map $http_upgrade $connection_upgrade {
        default upgrade;
        ''      close;
    }
    include gzip.conf;
    include cache.conf;
    include server.conf;
    include brotli.conf;
    include zstd.conf;
    include /usr/local/openresty/nginx/conf.d/*.conf;
}
