Quantcast
Channel: HAProxy community - Latest topics
Viewing all articles
Browse latest Browse all 4849

Start with HTTP, add HTTPS when certificates are available

$
0
0

What I’d like to achieve is to have HAProxy running in a docker container, proxying requests to website containers and to a container obtaining certificates. For apparent reasons I need to start with HTTP. Then when the certificates container obtains the certificate I want it to reload HAProxy, enabling HTTPS as a result.

I see that HAProxy has conditional blocks, but they can’t check for existence of files (.if exists(/path/to/certificate)). I can’t integrate a new value of an environment variable into a process. So it seems like the options are:

  • Enable HTTPS settings .if defined(HTTPS). I don’t like the idea of changing the way a container starts, so I guess I need some wrapper that sets HTTPS=1 if the certificate exists and starts HAProxy.
  • Generate the config from a template. The first approach looks simpler.

In both cases I need to restart the HAProxy container.

Any better ideas?

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 4849

Trending Articles



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