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

Xiangong Yang monitor.xoyo at gmail.com
Fri Jun 15 13:56:17 UTC 2012


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})
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20120615/7b26d462/attachment-0001.html>


More information about the nginx mailing list