hi
ngx.location.capture 只能调用vhost内部location的uri,如果我想调用外部的uri的话,那么我该使用哪个方法呢?
希望还是像ngx.location.capture非阻塞的请求方式。
--
邮件自: 列表“openresty”,专用于技术讨论!
发言: 请发邮件到 open...@googlegroups.com
退订: 请发邮件至 openresty+...@googlegroups.com
详情: http://groups.google.com/group/openresty
官网: http://openresty.org/
仓库: https://github.com/agentzh/ngx_openresty
建议: 提问的智慧 http://wiki.woodpecker.org.cn/moin/AskForHelp
教程: http://agentzh.org/misc/nginx/agentzh-nginx-tutorials-zhcn.html
nginx 1.2.3编译时出错了
--add-module=/usr/local/src/nginx-1.2.3/debian/modules/lua-resty-http \
>config.status.full
make: *** [config.status.full] 错误 1
dpkg-buildpackage: 错误: debian/rules build 提供错误退出状态 2
2012/10/7 kobeng <benw...@gmail.com>:
> 章老师 这个部分有无有计划整合在nginx lua模块里面呢?
>
lua-resty-* 库都是独立于 ngx_lua 模块的。我不可能把 lua-resty-* 整合进 ngx_lua 里面去。不过包含进
ngx_openresty 软件包是可能的,事实上 ngx_openresty 已经包含了 lua-resty-mysql,
lua-resty-memcached, lua-resty-redis, lua-resty-dns, lua-resty-upload,
和 lua-resty-string.
lua-resty-http 目前的状态还没达到包含进 ngx_openresty
的水平,我打算对它进行扩展和重构,或者另外再搞一个实现,然后再包含进 ngx_openresty :)
> 如果用ngx.location.capture 请求 同一个host里面的proxy pass,效果是不是一样非阻塞的?
>
所有由 ngx_lua 提供的 Lua API 都是非阻塞 I/O,自然也包括 ngx.location.capture :) 阻塞总是不可接受的。
Best regards,
-agentzh

-agentzh
--
邮件自: 列表“openresty”,专用于技术讨论!
发言: 请发邮件到 open...@googlegroups.com
退订: 请发邮件至 openresty+...@googlegroups.com
详情: http://groups.google.com/group/openresty
官网: http://openresty.org/
仓库: https://github.com/agentzh/ngx_openresty
建议: 提问的智慧 http://wiki.woodpecker.org.cn/moin/AskForHelp
教程: http://agentzh.org/misc/nginx/agentzh-nginx-tutorials-zhcn.html
-agentzh
2012/10/7 Lance <lance...@gmail.com>:
> 这里有一个之前我就注意到过,后来忘掉的 lua-resty-string,前两天就为了实现 random strong
> 费了半天力气,今天看到这里已经有了。
>
呵呵
> 在它的页面 https://github.com/agentzh/lua-resty-string
> 没有使用文档,只有一些例子,想看有什么功能还得去翻源码,或者从例子里猜。
>
欢迎贡献文档补丁 :)
> 另外 lua-resty-* 系列,能否有一个总的文档,甚至 openresty 发行包的总体功能说明文档,指导用户去哪里找相关的功能呢?
>
欢迎贡献 :D
> 对了,还有两个我最近一直在纠结的功能,类似 php 的 explode 和
> str_replace,基于纯字符串而不是正则表达式的字符串切分和替换,这个在实际使用中我觉得比正则的更加常用。我自己做了一些实现(前两天那些邮件大多与此有关),但总感觉性能不太满意,你看看是否可能扩展在这个包里面呢?
>
这两个可以有 :) 欢迎贡献补丁 :)
Best regards,
-agentzh
Best regards,
-agentzh
2012/10/7 Lance <lance...@gmail.com>:
> ok 那先来一个 explode,功能接口与php定义完全一样
>
多谢你提供的实现。不过,你能否以 github pull request 的形式提供补丁呢?同时再提供一些相应的测试用例?
多谢,多谢!
Best regards,
-agentzh
Best regards,
-agentzh
2012/10/7 Lance <lance...@gmail.com>:
> 实话实说,我不太会用git提交代码,我可以试试
>
多谢! :)
> 另外测试用例是写个 .t 吗?没看太明白
>
.t 是测试文件。我们的测试集都是 Test::Nginx 库驱动的:
http://search.cpan.org/perldoc?Test%3A%3ANginx
http://search.cpan.org/perldoc?Test%3A%3ANginx%3A%3ASocket
如果你有任何问题,也欢迎在邮件列表中交流 :)
多谢!
Best regards,
-agentzh
多谢!
Best regards,
-agentzh
2012/10/7 郭勇 <wolf...@gmail.com>:
> 内部的location里用proxy_pass访问外部uri是否可行?
>
internal location 可以使用 proxy_pass 访问外部 URI,只是 internal location
本身不能直接从外部通过 HTTP 协议被访问到而已。
Best regards,
-agentzh
2012/10/8 Lance <lance...@gmail.com>:
> https://github.com/lancelijade/lua-resty-string
> 弄好了一个,pull request也提交了,.t 按照你原来的文件仿写了一个,不知道实际怎么测,麻烦有时间看一下
>
多谢!我后面找时间看一下 :)
我这会儿正在准备新的 ngx_openresty 稳定版 1.2.3.8 的发布 :) 然后我们就可以把 ngx_lua 模块的
"thread" 分支合回 "master" 啦 :D
Thanks!
-agentzh