Peter Leonov gojpeg at
Sun Dec 20 06:08:24 MSK 2009

On 20.12.2009, at 5:31, dylanz wrote:

> Yep, I think you got it ;)
> So on the first request to this URI:
> ... we may set the following data in Memcached for that resource:
> key:     /blah/9999999.json
> value:  john: {age: 20, gender: 'male'}
> The next request to the same resource may look like this:
> ... so since the $memcached_key will match, Nginx will want to respond with:
> john: {age: 20, gender: 'male'}
> However, we really want to respond with the above value, but wrapped in the callback value from the request, like:
> ding2222222(john: {age: 20, gender: 'male')

If this url looks good for you

please try to create wrap.html with the following content:
<!--# echo var="arg_callback" -->(<!--# include virtual="$arg_key" -->)
and do not forget to enable SSI in its location ;)

You can think about SSI as a small and efficient scripting language within nginx.

Good luck,

More information about the nginx mailing list