@zahid.k11 wrote:
Hi Team,
I'm trying to force https on my test website. I have the following config "haproxy > Nginx > Tomcat". However whenever I add "redirect scheme https if !{ ssl_fc }" to force https my login stops. Currently, both http and https are working well individually. The following is my configuration. I have separate frontend & backend for http and https. Not sure where I am going wrong. Please help!!
frontend http-test-80
bind 192.168.1.10:80
mode http
reqadd X-Forwarded-Proto:\ httpredirect scheme https if !{ ssl_fc } acl host_test80 hdr(host) -i test.zahid.com use_backend static_test if host_test80 acl host_test80 hdr(host) -i static1.test.zahid.com use_backend static_test if host_test80backend static_test
balance roundrobin
option httpclose
option forwardfor
cookie static insert indirect nocache
option httpchk HEAD /LoadBalancer_HealthCheck.php HTTP/1.0
server stat-test 192.168.1.20:80 cookie mpstatic1 check=================================================================================
frontend http-test-443
bind 192.168.1.10:443 ssl crt /etc/haproxy/certs/test.zahid.com/test.zahid.com.pem
reqadd X-Forwarded-Proto:\ httpsacl host_test443_secure hdr(host) -i test.zahid.com use_backend static_test_secure if host_test443_secure acl host_test443_secure hdr(host) -i static1.test.zahid.com use_backend static_test_secure if host_test443_securebackend static_test_secure
balance roundrobin
option httpclose
option forwardfor
redirect scheme https if !{ ssl_fc }
cookie static insert indirect nocache
option httpchk HEAD /LoadBalancer_HealthCheck.php HTTP/1.0
server stat-test-secure 192.168.1.20:80 cookie mpstatic2 checkBest Regards,
Zahid
Posts: 2
Participants: 2