Http to https site with balancing

still not working sir… thanks for your time…

frontend localhost
bind *:80
option tcplog
mode http
default_backend nodes
stats enable
stats hide-version
stats uri /stats
stats realm Haproxy\ Statistics
stats auth bunga:kamimasihmuda # Credentials for HAProxy Statistic report page.

backend nodes
mode http
balance roundrobin
option forwardfor
option ssl-hello-chk

http-request set-header Host emos.enseval.com(disabled)

http-request set-header Host api.enseval.com(disabled)

http-send-name-header Host
server web01 emos.enseval.com:443 ssl verify none sni str(emos.enseval.com)
server web02 api.enseval.com:443 ssl verify none sni str(api.enseval.com)

if i use http-request set-header Host emos.enseval.com it work… but if i add http-request set-header Host api.enseval.com, emos.enseval will not work… only api.enseval.com will work…

thanks for your help sir… i appreciate it :slight_smile:

You did the opposite of what I just suggested.

Do not set any http-request set-header Host at all, instead put http-send-name-header Host into your backend configuration, that way, the Host header is set to the actual server name configured.

1 Like

I did what u say sir…

I disabled
http-request set-header Host

And just use
http-send-name-header Host
But both emos and api didn’t work…

If i just use
http-request set-header Host

Only one will work…

I forgot, you also have to adjust the name of the server (http-send-name-header uses the internal server name in haproxy, not the hostname specified, so you need to replace web01 and web02):

backend nodes
 mode http
 balance roundrobin
 option forwardfor
 option ssl-hello-chk
 http-send-name-header Host
 server emos.enseval.com emos.enseval.com:443 ssl verify none sni str(emos.enseval.com)
 server api.enseval.com api.enseval.com:443 ssl verify none sni str(api.enseval.com)
1 Like

omg sir… its work like a charm…
this is what i want, you made my day sir… really thanks… many thanks sir…
god bless you…

finnally this work… i really apreciate your help sir… thanks a lot…

how happy iam … from asian with love… thanks sir… your my man

1 Like