I use the agenzh’s two modules
*nginx configuration:
*
location ~ “^/property/([0-9]+)” {
charset utf-8;
default_type ‘text/javascript’;
echo -n “$arg_callback({"property_$1":"”;
echo_location_async /statistic/operator
“cmd=incr&key=property_$1&value=1”;
echo -n “")”;
}
# GET /statistic/operator?cmd=incr&key=property_23214&value=2
# GET /statistic/operator?cmd=decr&key=property_23214&value=1
location /statistic/operator {
internal;
set $memc_cmd $arg_cmd;
set $memc_key $arg_key;
set $memc_value $arg_value;
memc_pass statistics_server_pool;
memc_cmds_allowed incr decr set get delete add;
add_header X-Memc-Flags 'Statistic Crement';
}
*Request URL:
*
http://domain.net/property/23458?hi=231231&callback=himycallback201203455
The Unexpected incorrect Output: (Current Configuration)
himycallback201203455({“property_23458”:24
})
The new line after 24 is unexpected. and how can l delete the new line ?
I expected the correct Output: ( how to configuration the nginx ? )
himycallback201203455({“property_23458”:24})