现在的位置: 首页Nginx>正文
ngx_eval
2011年03月11日 Nginx ngx_eval已关闭评论 ⁄ 被围观 7,949 次+

People have been reporting issues of my fork of ngx_eval when using it with recent versions of nginx. I’ve updated it to version 2011.01.12 to compatible with nginx 0.8.54+:

https://github.com/agentzh/nginx-eval-module/downloads

Now "eval_subrequest_in_memory" is off by default. Because subrequest_in_memory mode is still having issues.

Here’s a small example for using ngx_eval with my ngx_redis2, an nginx upstream module that supports almost the full Redis 2.0 unified wire protocol:

  1. location /foo
  2. {
  3. eval_override_content_type ‘application/octet-stream’;
  4. eval_subrequest_in_memory off;
  5. eval $res
  6. {
  7. redis2_literal_raw_query ‘set one 5\r\nfirst\r\n’;
  8. redis2_pass 127.0.0.1:6379;
  9. }
  10. echo [$res];
  11. }

Accessing /foo with curl yields

[+OK]

on my side.

Please ensure that you’re using nginx 0.8.54+ and the latest version of my fork of ngx_eval (at lease 2010.12.29+ is required).

If you find any issues, please let me know.

Special thanks go to Valery Kholodkov for creating ngx_eval in the first place.

P.S. Still, it’s recommended to use ngx_lua module’s rewrite_by_lua or access_by_lua directives combined by the "ngx.location.capture" API to do what my fork of ngx_eval has been doing.

本文地址:http://www.92csz.com/33/21.html
如非注明则为本站原创文章,欢迎转载。转载请注明转载自:moon's blog
 

抱歉!评论已关闭.