Welcome! Log In Create A New Profile

Advanced

Trigger alternate response based on file presence or other URL response

October 18, 2018 12:50PM
Hi.

I'll try to make this make sense. I have a few web applications that I can't change. They are behind an nginx+ loadbalancer. I have separate database state that indicates whether or not requests should be forwarded to the upstream, or a status page should be returned.

There is a web service that I can invoke that gives me access to the database state. I tried using that service as a health_check uri to change the upstream to "failed", but that doesn't work as the uri is just a path appended to the host+port.

I could have something monitoring the database state web service running on the nginx server instance that could, for example, create a flag file on the nginx server instance that could indicate to nginx how it should deal with the requests, but I'm not sure if/how I could configure that in nginx.

Would anyone have any suggestions on how I can control how nginx responds based on state that isn't the upstream?

Many thanks for your help.
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: 193
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