Hi.

I try to use automatically the backend server when the primary serve is not 
available.

The following snipplet is my solution with haproxy (2.1.3-3ppa1~bionic).
Is there a bette solution or is this a okay solution from HAProxy point of view?

```
backend be_static
  log global
  option httpchk GET {{ http_checks["static_http"]}} HTTP/1.1\r\nHost:\ {{ 
hosts["static_http"]}}

  # check if the primary server is up
  acl use_prim srv_is_up(static_prim)
  http-request set-header Host {{ hosts["static_http"] }} if use_prim

  http-request set-header Host {{ hosts["static_storage"] }} if ! use_prim
  http-request set-path /v1/AUTH_OBJ-URL/Static%[path] if ! use_prim

  server static_prim {{ hosts["static_http"] }}:443 resolvers mydns ssl check check-ssl check-sni 
{{ hosts["static_http"] }} sni str({{ hosts["static_http"] }}) ca-file 
/etc/haproxy/letsencryptauthorityx3.pem
  server static_stor {{ hosts["static_storage"] }}:443 resolvers mydns ssl check check-ssl 
check-sni {{ hosts["static_storage"] }} sni str({{ hosts["static_storage"] }}) ca-file 
/etc/haproxy/Sectigo_RSA_Domain_Validation_Secure_Server_CA.pem backup
```

Best regards

Aleks

Reply via email to