Welcome! Log In Create A New Profile

Advanced

Re: using upstream module that won't override the original request

agentzh
April 14, 2013 04:22PM
Hello!

On Sun, Apr 14, 2013 at 6:22 AM, gadh wrote:
> I'm trying to hold a client request to backend (not go to the server yet),
> issue an upstream request to another server, then parse the upstream
> response, store it in my orig. request ctx, only then go to backend server
> (original request), and in the output filter inject some of the ctx data i
> stored before - to the backend response.
>
> i tried to do all that with a subrequest but then Maxim told me that the
> subrequest was not designed for that - hence no support in my method.
> Now if i use upstream instead - it overrides the original request and sends
> its own response to the client.
> so how can i achieve my goal ?

I don't understand what you're saying completely, but you may find the
subrequest API provided by ngx_lua fit your needs:

http://wiki.nginx.org/HttpLuaModule#ngx.location.capture

And also its cosocket API:

http://wiki.nginx.org/HttpLuaModule#ngx.socket.tcp

I think you can just write a little Lua to do your task without
writing your own nginx C module. Well, just a suggestion.

Best regards,
-agentzh

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

using upstream module that won't override the original request

gadh April 14, 2013 09:22AM

Re: using upstream module that won't override the original request

agentzh April 14, 2013 04:22PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 278
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready