Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can you add the support the of two eval module in two different location for the same request? #7

Open
yaoweibin opened this issue Dec 3, 2010 · 1 comment

Comments

@yaoweibin
Copy link

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;

@vkholodkov
Copy link
Owner

This looks reasonable, I'll see what I can do for you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants