Answer the question
In order to leave comments, you need to log in
Is it possible to check the availability of a site before redirecting?
Is it possible to configure Apache in such a way that the redirect from http to the https version of the site occurs only if the https version is working?
For example, in the VirtualHost section for all sites, a set of rewrite rules is written, which works only when the https version of the same site is working (configured by separate configs, not for all sites).
Answer the question
In order to leave comments, you need to log in
You can put haproxy between Apache and the site, and in the case when haproxy receives 500s from the "https" page, it automatically transfers the entire load to another available, so to speak, backend.
don't do that! especially if you have at least some kind of load.
almost certainly we are talking about several hosts and not the entire Internet, which means that you need a separate process to monitor availability and edit configs programmatically, apache2 reload works well.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question