K
K
Kirill_Ulyanov2018-11-16 15:46:44
Apache HTTP Server
Kirill_Ulyanov, 2018-11-16 15:46:44

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

2 answer(s)
S
s4kro, 2018-11-16
@s4kro

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.

R
rPman, 2018-11-16
@rPman

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 question

Ask a Question

731 491 924 answers to any question