subrequest示例
来源:互联网 发布:淘宝快递打印机设置 编辑:程序博客网 时间:2024/06/05 15:24
访问/query?s_sh000001时,访问http://hq.sinajs.cn
配置文件中子请求的设置
location /list{ //决定访问的上游服务器地址是hq.sinajs.cn proxy_pass http://hq.sinajs.cn; //不希望第三方服务发来的http包体进行过gzip压缩 proxy_set_header Accept-Ecoding "";}当然,处理/query开头的URI用户请求还需要使用自己的模块 location /query{ mytest; }
请求上下文
此处仅用于保存子请求回调方法中解析出来的数据
typedef struct{ ngx_str_t stock[6];}ngx_http_mytest_ctx_t;
子请求结束时的处理方法
定义mytest_subrequest_post_handler作为子请求结束时的回调方法
在其中设置父请求的回调方法
父请求的回调方法
启动subrequest
在处理用户请求的ngx_http_mytest_handler中创建subrequest子请求
0 0
- subrequest示例
- nginx subrequest程序示例
- 用Lua替代subrequest
- nginx subrequest的实现解析
- nginx subrequest的实现解析
- nginx module开发利器:subrequest
- nginx subrequest的一个坑
- ngix:subrequest 的 用途 和 使用流程
- Nginx 中的 upstream 与 subrequest 机制
- nginx访问第三方服务之subrequest使用
- 利用nginx subrequest实现与多个后端server的交互
- 《深入理解Nginx》阅读与实践(三):使用upstream/subrequest访问第三方服务
- Nginx模块开发(4)————使用subrequest访问第三方服务
- 示例
- 示例
- 示例
- 示例
- 示例
- Maple OpenMaple (API) 开发系列-2.0 Java开发环境搭建
- startService和bindService
- 【LeetCode】Power of Three 解题报告
- 该使用pthread_sleepon_signal() 还是 pthread_sleepon_broadcast()
- RxJava组合操作符
- subrequest示例
- 使用JAVA将Hadoop HDFS中的日志文件导入HBase中(一)
- 网布局
- Apache+Tomcat服务器集群配置详细步骤
- MySQL 单表查询
- 对c语言的一些看法
- 浅谈提高团队成员的工作积极性
- Unity3D中角色的动画脚本的编写
- 剑指offer(64):二叉搜索树的第k大的节点