I have this need:
1, A request is sent to backend server with eval module.
2, If the eval response is '0', I want to rewrite this request to a second location.
3, In the second location, I also have a eval module. But It seem that the eval does not work in this location.
I changed the source a little, It seems works for me:
diff --git a/ngx_http_eval_module.c b/ngx_http_eval_module.c
index 402bbb6..fb7eaab 100644
--- a/ngx_http_eval_module.c
+++ b/ngx_http_eval_module.c
@@ -180,6 +180,16 @@ ngx_http_eval_handler(ngx_http_request_t *r)
ngx_http_set_ctx(r, ctx, ngx_http_eval_module);
}
- if (ecf != ctx->base_conf) {
-
-
-
-
ctx->current_block = ecf->blocks->elts;
-
ctx->last_block = ctx->current_block + ecf->blocks->nelts - 1;
- }
if(ctx->done) {
ctx->in_progress = 0;
I have this need:
1, A request is sent to backend server with eval module.
2, If the eval response is '0', I want to rewrite this request to a second location.
3, In the second location, I also have a eval module. But It seem that the eval does not work in this location.
I changed the source a little, It seems works for me:
diff --git a/ngx_http_eval_module.c b/ngx_http_eval_module.c
index 402bbb6..fb7eaab 100644
--- a/ngx_http_eval_module.c
+++ b/ngx_http_eval_module.c
@@ -180,6 +180,16 @@ ngx_http_eval_handler(ngx_http_request_t *r)
ngx_http_set_ctx(r, ctx, ngx_http_eval_module);
}
if(ctx->done) {
ctx->in_progress = 0;