nginx-eval-module
nginx-eval-module copied to clipboard
Can you add the support the of two eval module in two different location for the same request?
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->in_progress = 0; -
ctx->done = 0; -
ctx->base_conf = ecf; -
ctx->current_block = ecf->blocks->elts; -
ctx->last_block = ctx->current_block + ecf->blocks->nelts - 1; - } + if(ctx->done) { ctx->in_progress = 0;
This looks reasonable, I'll see what I can do for you