Trigger alternate response based on file presence or other URL response

Reinis Rozitis r at
Thu Oct 18 22:43:40 UTC 2018

> Wondering if there is a way to use the URL endpoint to check.

One way to do it would be with:

You said you have nginx+ which has the ability to reconfigure the the backends on the fly:

So your application which can read the state from the database could just set the upstream(s) as down so nginx won't forward any requests.

Another (more advanced) way would be to do it inside nginx with lua ( ) wich can connect directly to the database (mysql/pgsql etc) and decide what response to return. Then again it's more complicated.


More information about the nginx mailing list