Hello!
On Wed, Jul 25, 2012 at 7:53 AM, James Wallace wrote:
> I went ahead and installed the modules and got everything back up and
> running. However I am still having the same issue. The response from the
> Redis server is still being output to the browser window (which is what I'm
> trying to avoid).
>
> Here is the relevant snippet from my nginx.conf:
>
> location /timing {
> content_by_lua '
> res = ngx.location.capture("/redis", {
> copy_all_vars = true
> } )
> ';
> }
>
> location /redis {
> redis2_query incr $arg_key;
> redis2_pass 127.0.0.1:6379;
> }
>
Try this:
location = /timing {
content_by_lua '
res = ngx.location.capture("/redis?" .. ngx.var.args)
ngx.say("we are done!")
';
}
location = /redis {
internal;
redis2_query incr $arg_key;
redis2_pass 127.0.0.1:6379;
}
> I'm making a request to server.com/timing?key=abc
>
I suggest you use command-line tools like "curl" to test your
interface first, to prevent content caching in your web browser. On my
machine, I'm getting this with the config above:
$ curl localhost/timing?key=abc
we are done!
Best regards,
-agentzh