# Sub-requests to an upstream server

**URL:** <https://www.ruby-forum.com/t/sub-requests-to-an-upstream-server/236275>\
**Category:** NGINX\
**Created:** [August 20, 2013, 5:43pm UTC](https://www.ruby-forum.com/t/sub-requests-to-an-upstream-server/236275 "2013-08-20T17:43:47Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![addis\_a](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/c4cdca/32.png) [@addis\_a](https://www.ruby-forum.com/u/addis_a)\
**Post date:** [August 20, 2013, 5:43pm UTC](https://www.ruby-forum.com/t/sub-requests-to-an-upstream-server/236275/1 "2013-08-20T17:43:47Z")

</div>

Hello,

I am writing an nginx plugin and I am trying to send sub-requests to an  
upstream server.  
I am aware of the ngx\_http\_subrequest function but I didn’t succeed to  
use  
it in my case and I am not sure it is what I need.

In my use case, I have a structure in shared memory. This structure must  
leave as long as some conditions are fulfilled based on several  
sequential  
sub-requests to an upstream server. My first problem is that  
ngx\_http\_subrequest must have a server request to work. I would prefer  
to  
send a client request based on an internal event (in my case a timer  
event).  
If this is not possible, I can use a server request to do that but in  
that  
case I don’t want to add sub-requests responses content to the response  
body. Is this possible ? Do you have any advice ?

Thanks

Posted at Nginx Forum:

> **[Sub-requests to an upstream server](https://forum.nginx.org/read.php?2,242054,242054#msg-242054)**
>
> Hello, I am writing an nginx plugin and I am trying to send sub-requests to an upstream server. I am aware of the ngx\_http\_subrequest function but I didn't succeed to use it in my case and I am not sure it is what I need. In my use case, I have a...
