Force download a file through https

Hi, I have a working haproxy, but when I download a file through https, look like the file download through http, the google chrome browser make a warnig telling the conexion is no secure, how can I do to force the download through https?


I don’t know what is your configuration but your HaProxy probably listen on HTTP and HTTPs ports. You can of-course redirect HTTP traffic to HTTPs:

acl https_conn ssl_fc
http-request redirect scheme https if !https_conn 

Hi findmyname.

Yes I have redirect http trafic to https. when I request a page via http the proxy redirect me to https, as I spect, but when I downloan a file using, I get this warning

I paste my configuration file:

maxconn 1000
stats socket /tmp/haproxy.socket level admin expose-fd listeners
uid 80
gid 80
nbproc 1
nbthread 1
hard-stop-after 15m
chroot /tmp/haproxy_chroot
tune.ssl.default-dh-param 2048
server-state-file /tmp/haproxy_server_state

frontend HTTPS-front
bind name ssl crt-list /var/etc/haproxy/HTTPS-front.crt_list
mode http
log global
option http-keep-alive
timeout client 30000
acl web2 var(txn.txnhost) -m str -i
acl aclcrt_HTTPS-front var(txn.txnhost) -m reg -i ^[0-9]){1,5})?$
http-request set-var(txn.txnhost) hdr(host)
use_backend webserv_ipvANY if web2 aclcrt_HTTPS-front
use_backend webserv_ipvANY if aclcrt_HTTPS-front

frontend http-redirect-https
bind name
mode http
log global
option http-keep-alive
timeout client 30000
http-request redirect scheme https

backend webserv_ipvANY
mode http
id 102
log global
timeout connect 30000
timeout server 30000
retries 3
option httpchk OPTIONS /
server webserv01 id 103 check inter 1000

Provide the output of

curl -Ivvk