# Nginx module dev question

**URL:** <https://www.ruby-forum.com/t/nginx-module-dev-question/163832>\
**Category:** NGINX\
**Created:** [March 25, 2009, 10:36am UTC](https://www.ruby-forum.com/t/nginx-module-dev-question/163832 "2009-03-25T10:36:32Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Delta\_Y](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/f9ae1b/32.png) [@Delta\_Y](https://www.ruby-forum.com/u/Delta_Y)\
**Post date:** [March 25, 2009, 10:36am UTC](https://www.ruby-forum.com/t/nginx-module-dev-question/163832/1 "2009-03-25T10:36:32Z")

</div>

Hi all,  
I want to implement the following feature:

1. client HEAD request arrive , my module send it to an upstream.
2. the upstream return response.
3. my module check the response, if it is not the data I want, send the  
origin request to another upstream

I know the block mode will work. I want to know if there is  
asynchronous  
mode which will fit into nginx better?

BR,  
DeltaY

---

<div class="post-metadata">

**Author:** ![Delta\_Y](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/f9ae1b/32.png) [@Delta\_Y](https://www.ruby-forum.com/u/Delta_Y)\
**Post date:** [April 3, 2009, 1:00pm UTC](https://www.ruby-forum.com/t/nginx-module-dev-question/163832/2 "2009-04-03T13:00:40Z")

</div>

I think you can write an upstream module to resolve it.

use the HEAD you get, to make a request, send the new request to the  
upstream you want to sent, get the response, check it,

and then you can use ngx\_http\_internal\_redirect£¨£© function to redirect  
the origin request to another upstream you defined.

just do it, good luck!

2009/3/25 Delta Y. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

---

<div class="post-metadata">

**Author:** ![Delta\_Y](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/f9ae1b/32.png) [@Delta\_Y](https://www.ruby-forum.com/u/Delta_Y)\
**Post date:** [April 3, 2009, 2:19pm UTC](https://www.ruby-forum.com/t/nginx-module-dev-question/163832/3 "2009-04-03T14:19:48Z")

</div>

Thanks for your suggestion.

2009/4/3 Yu.Cheung [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
