Welcome! Log In Create A New Profile

Advanced

Re: Forward request after operation with worker?

Yichun Zhang (agentzh)
November 25, 2015 11:16PM
Hello!

On Wed, Nov 18, 2015 at 6:48 AM, Stephane Wirtel wrote:
> With a request, is it possible to redirect to a running worker and if
> this one is not running, just enable it.
>
> I explain, I would like to implement a reverse proxy with Lua and
> OpenResty and Redis.
>
> Redis will store a mapping between the hostname and a tuple (ip of the
> worker:port).
>
> But the workers can be down, because unused in time.
>
> I was thinking to keep the request, execute a "light thread" in Lua
> (with a timeout of 1s). The light thread will active the worker.
> If the timeout is reached, we return an error, else we send the request
> to the worker.
>
> 1. Is it possible ?
> 2. I would like to know how will you make that, I don't know Lua, just used
> it in the past just for small scripts with imapfilter or a PoC with
> OpenResty.

Sorry, I don't really understand what you're trying to achieve. Are
you trying to make the nginx workers talk to each other? Maybe you can
use the lua_shared_dict to share your data among them?

BTW, it's recommended to post to the openresty-en mailing list for
OpenResty specific questions. Please see
https://openresty.org/#Community Thanks!

Best regards,
-agentzh

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

Forward request after operation with worker?

Stephane Wirtel November 17, 2015 05:50PM

Re: Forward request after operation with worker?

Yichun Zhang (agentzh) November 25, 2015 11:16PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 345
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready