You are binding twice to port 443, you cannot do that. Your OS will load-balance between the two frontend which is absolutely NOT what you want.
You need a single frontend on port 443, in TCP mode, which is looking at the SNI value for routing decision making. For domains that you want to terminate locally, you need to define a backend that reconnects to a SSL terminating frontend with your configuration.
So for example:
- move the
frontend load-balancer
fromport *:443
to127.0.0.1:1443
- create a backend in tcp mode to reconnect to
127.0.0.1:1443
- use that backend as a default_backend in
wildcard_tcp
, as opposed towebservers
Also see this example (slightly different use-case):