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?

Hi,

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 https://test.xxxxxxxxx.com.ve/example_file.pdf, I get this warning
chrome_error

I paste my configuration file:


global
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
daemon
tune.ssl.default-dh-param 2048
server-state-file /tmp/haproxy_server_state

frontend HTTPS-front
bind 192.168.1.200:443 name 192.168.1.200:443 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 test.xxxxxxxxx.com.ve
acl aclcrt_HTTPS-front var(txn.txnhost) -m reg -i ^test.xxxxxxxxx.com.ve(:([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 192.168.1.200:80 name 192.168.1.200:80
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 192.168.100.12:80 id 103 check inter 1000

Provide the output of

curl -Ivvk  https://test.xxxxxxxxx.com.ve/example_file.pdf