call a location and use the returened header status

101 views Asked by At

I've two locations on my Nginx config:

location /ok {
    return 200;
}

location /check {
    # pseudo code
    if (call(http://localhost:9090/ok) == 200) do something
}

I just can use Nginx and think one solution it can be proxy_pass /check to /ok and if everything were OK proxy_pass request again to a new location, Any idea?
Thanks

0

There are 0 answers