body_filter_by_lua_block { local response_body = ngx.arg[1] response_body = string.gsub(response_body, "if (h) jQuery(\"a[href*=\" + h + \"]\").click()", "if (h) jQuery(\"body\").find(\"a[href*=\" + h + \"]\").click()") ngx.arg[1] = response_body return response_body }