Multiple SSL HAProxy

Multiple SSL HaProxy ini diperlukan Jika dalam 1 Server Haproxy terdapat 2 SSL yang berbeda, Misalnya domain www.example.com dan www.contoh.com. Berikut Konfigurasi haproxy.conf jika multiple SSL.

frontend secure-http-in
bind *:80
bind *:443 ssl crt /usr/local/etc/ssl/riaunew.pem crt /usr/local/etc/ssl/dumai.pem
redirect scheme https if !{ ssl_fc } # <- Jika semua domain redirect ke https

mode http
option httplog
log global

acl host_example hdr(host) -i www.example.com
acl host_contoh hdr(host) -i www.contoh.com

    use_backend example-WWW if host_example
    use_backend contoh-WWW if host_contoh
   
backend example-WWW
         log  127.0.0.1 local6
         option httplog
         http-request set-header X-Forwarded-Port %[dst_port]
         mode http
         balance roundrobin
#        cookie JSESSIONID prefix nocache
         cookie SERVERID insert indirect nocache
         server EXAMPLE-WWW-1 192.168.79.37:443 maxconn 1024 cookie SRV1 check
#         server EOFFICE-WWW-2 192.168.79.38:443 maxconn 1024 cookie SRV2 check backup


backend contoh-WWW
         log  127.0.0.1 local6
         option httplog
         http-request set-header X-Forwarded-Port %[dst_port]
         mode http
         balance roundrobin
#        cookie JSESSIONID prefix nocache
         cookie SERVERID insert indirect nocache
         server contoh-WWW-1 192.168.79.40:443 maxconn 1024 cookie SRV1 check
#         server contoh-WWW-2 192.168.79.41:443 maxconn 1024 cookie SRV2 check backup

Restart Haproxy..
NB : Konfigurasi diatas Jika semua domain harus redirect ke https, jika salah satu tidak redirect maka konfigurasi Haproxy.cfg sebagai berikut :

frontend secure-http-in
         bind *:443 ssl crt /usr/local/etc/ssl/example.pem crt    /usr/local/etc/ssl/contoh.pem

         mode http
         option httplog
         log global
         acl host_example hdr(host) -i www.example.com
         acl host_contoh hdr(host) -i www.contoh.com
         use_backend example-WWW if host_example
         use_backend contoh-WWW if host_contoh

use_backend example-WWW if host_example
    use_backend contoh-WWW if host_contoh

frontend http-in
 
         frontend http-in
         bind *:80
         redirect scheme https if { hdr(Host) -i example.com } !{ ssl_fc } #Jika hanya domain exampel.com saja yang akan di redirect ke https
      
         acl host_example hdr(host) -i www.example.com
         acl host_contoh hdr(host) -i www.contoh.com
         use_backend example-WWW if host_example
         use_backend contoh-WWW if host_contoh

***** Untuk Backend sama contoh diatas


Posted on: August 21, 2019, by :  | 26 views
https://serang.ut.ac.id/css/css/slot88/ https://tinjut.bagkeu.dikdasmen.kemdikbud.go.id/slot-maxwin/ https://dpm.polinema.ac.id/slot-gacor/ https://akademik.ft.unm.ac.id/slot-dana/ https://ppdb.probolinggokab.go.id/slot-5000/ https://bkad.sulselprov.go.id/assets/ https://ojs.balidwipa.ac.id/docs/slot-gacor/ http://korpri.pekalongankab.go.id/api/slot-gacor/ https://elang.umpp.ac.id/foto/farmasi/-/asset/ http://rsud-kelet.jatengprov.go.id/wp-content/-/asset/ https://kusdhianto-fe.staff.ugm.ac.id/slot88/ http://ppdb.probolinggokab.go.id/judi-bola/ https://bapenda.labuhanbatukab.go.id/racikan-sbobet/ http://rsud-kelet.jatengprov.go.id/wp-content/-/data/ https://agenda.riau.go.id/-/judi-bola/ https://balapan.padang.go.id/sbobet88/ http://jdih.wakatobikab.go.id/sbobet88/ http://kph.menlhk.go.id/sbobet88/ https://bkad.sulselprov.go.id/data/ https://dpm.polinema.ac.id/slot-gacor/ https://dinkes.jemberkab.go.id/storage/attachments/