Nginx : Reverse Proxy + Redis

1,479 views
Skip to first unread message

shubham srivastava

unread,
Sep 5, 2013, 1:32:23 AM9/5/13
to openre...@googlegroups.com
Hi,

I have an existing Nginx setup up and running to get an reverse proxy
working with caching support(Nginx InMemory). I have integrated it with
LUA to get some
customizations for changing request as per some biz rules. The system is
used for serving XML out the reverse proxy being a SOA server.

Now what I want is to have the below setup working with Redis Cache. (
Reason of using Redis is to keep the response broked up in way that the
next requests can use exploit even partial data from earlier responses.
I would merge the responses back to send the final xml. )


Request -> Check Redis Cache(Not Found) -> Go_To_Actual_Upstream Server
-> Save_Response_Back_To_Redis(asynch) -> Send the result back to client

Was wondering how to move ahead with the approach/design. Also from an
implementation point too.

I am a kind of newbie here.

Regards,
Shubham

Yichun Zhang (agentzh)

unread,
Sep 5, 2013, 1:37:01 AM9/5/13
to openresty-en
Hello!

On Wed, Sep 4, 2013 at 10:32 PM, shubham srivastava wrote:
> Now what I want is to have the below setup working with Redis Cache. (
> Reason of using Redis is to keep the response broked up in way that the
> next requests can use exploit even partial data from earlier responses.
> I would merge the responses back to send the final xml. )
>
> Request -> Check Redis Cache(Not Found) -> Go_To_Actual_Upstream Server
> -> Save_Response_Back_To_Redis(asynch) -> Send the result back to client
>

You can take a look at the ngx_srcache module which can work with Redis:

http://wiki.nginx.org/HttpSRCacheModule

And you can customize the settings of ngx_srcache with ngx_lua too.

Regards,
-agentzh

James Hurst

unread,
Sep 5, 2013, 4:53:16 AM9/5/13
to openre...@googlegroups.com
On 5 September 2013 06:32, shubham srivastava <shub...@gmail.com> wrote:
Hi,

I have an existing Nginx setup up and running to get an reverse proxy
working with caching support(Nginx InMemory). I have integrated it with
LUA to get some
customizations for changing request as per some biz rules. The system is
used for serving XML out the reverse proxy being a SOA server.

Now what I want is to have the below setup working with Redis Cache. (
Reason of using Redis is to keep the response broked up in way that the
next requests can use exploit even partial data from earlier responses.
I would merge the responses back to send the final xml. )
You might also want to take a look at the "Ledge" Lua module. It uses Redis and has some support for ESI, which may be useful in terms of reusing partial content, depending on what you're trying to do.



--
James Hurst
Reply all
Reply to author
Forward
0 new messages