Welcome! Log In Create A New Profile

Advanced

RE: Trigger alternate response based on file presence or other URL response

Reinis Rozitis
October 18, 2018 06:46PM
> Wondering if there is a way to use the URL endpoint to check.

One way to do it would be with: http://nginx.org/en/docs/http/ngx_http_auth_request_module.html


You said you have nginx+ which has the ability to reconfigure the the backends on the fly: http://nginx.org/en/docs/http/ngx_http_upstream_conf_module.html

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 ( https://github.com/openresty/lua-nginx-module ) wich can connect directly to the database (mysql/pgsql etc) and decide what response to return. Then again it's more complicated.

rr

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

Trigger alternate response based on file presence or other URL response

dhallam October 18, 2018 12:50PM

Re: Trigger alternate response based on file presence or other URL response

dhallam October 18, 2018 01:59PM

RE: Trigger alternate response based on file presence or other URL response

Reinis Rozitis October 18, 2018 06:46PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 214
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