# 在http目录下配置
# lua_shared_dict obf_cache 64m;

# 混淆配置-代理
body_filter_by_lua_block {
    local obf = require("resty.obf.obf")
    obf.process_response()
}

location / {
    proxy_pass http://127.0.0.1:8989;
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_hide_header Content-Encoding;
    #gzip off;
    proxy_set_header Accept-Encoding "";
    proxy_set_header If-Modified-Since "";
    proxy_set_header If-None-Match "";

    #set $close_close  'true';
    #set $debug_close  'true';
    set $obf_js_mode  'inline';
    set $obf_js_url  '';
    set $obf_timeout  600;
    set $obf_rand_var     'true';
    set $obf_rand_extra   'true';
    set $obf_uint8_b64 'true';
    set $obf_prof        'true';
    set $obf_cache_item_max 0;
    set $obf_cache_max_bytes 16777216;
    set $obf_kdf_raw 'false';

    header_filter_by_lua_block {
        ngx.header.content_length = nil
    }
}