Quantcast
Viewing all articles
Browse latest Browse all 4723

Redirect to https IF cert is present in store

Hi there,

I have an haproxy instance with many certs (100+) and even more so domains pointing to it.

I’d like to redirect as much traffic as possible to HTTPS. However, I don’t wan’t to redirect to HTTPS if a certificate compatible with the given domain is not present.

The certificates are loaded automatically (i.e. giving a folder to haproxy).

So the idea is to redirect to https only if the user comes via HTTP and a cert is present for the given host, something like so:

redirect scheme https if { hdr(Host),ssl_has_with_host } !{ ssl_fc }

where the ssl_has_with_host(host) is a function that returns true if Haproxy contains a certificate that can match against the given host.

Do you know how it could be done ?

Many thanks !

2 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 4723

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>