Welcome! Log In Create A New Profile

Advanced

an unexpected newline appears when use memc and echo_locat​ion_async, how to delete the newline ?

Xiangong Yang
June 15, 2012 09:58AM
I use the agenzh's two modules
http://wiki.nginx.org/HttpMemcModule
http://wiki.nginx.org/HttpEchoModule


*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})
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

an unexpected newline appears when use memc and echo_locat​ion_async, how to delete the newline ?

Xiangong Yang June 15, 2012 09:58AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 99
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready