Alternative approach would be to use error_page to catch the 5xx response (502
I think)
when there are no available upstream servers and then, from a named location,
proxy_pass
with HTTPS to the same upstream group.
Modifying the original sample config below.
There is a blog post for similar use
A small announcement to say that the sources for the nginx.org website
are now maintained on GitHub:
https://github.com/nginx/nginx.org
Issues and PRs are open so please feel free to make suggestions and/or
propose changes.
Cheers,
Liam.
___
nginx mail