Welcome! Log In Create A New Profile

Advanced

Forward request after operation with worker?

Stephane Wirtel
November 17, 2015 05:50PM
Hi,

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.

Thank you,

Stephane
--
Stéphane Wirtel - http://wirtel.be - @matrixise

_______________________________________________
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: 117
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