# Force download a file through https

**URL:** https://discourse.haproxy.org/t/force-download-a-file-through-https/7044
**Category:** Help!
**Created:** [October 31, 2021, 3:36am UTC](https://discourse.haproxy.org/t/force-download-a-file-through-https/7044 "2021-10-31T03:36:43Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![mestacio](https://avatars.discourse-cdn.com/v4/letter/m/c89c15/32.png) [@mestacio](https://discourse.haproxy.org/u/mestacio)
#### Post date: [October 31, 2021, 3:36am UTC](https://discourse.haproxy.org/t/force-download-a-file-through-https/7044/1 "2021-10-31T03:36:43Z")

</div>

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?

---

<div class="post-metadata">

### Author: ![findmyname](https://avatars.discourse-cdn.com/v4/letter/f/f0a364/32.png) [@findmyname](https://discourse.haproxy.org/u/findmyname)
#### Post date: [November 1, 2021, 2:38pm UTC](https://discourse.haproxy.org/t/force-download-a-file-through-https/7044/2 "2021-11-01T14:38:39Z")

</div>

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:

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

```

---

<div class="post-metadata">

### Author: ![mestacio](https://avatars.discourse-cdn.com/v4/letter/m/c89c15/32.png) [@mestacio](https://discourse.haproxy.org/u/mestacio)
#### Post date: [November 3, 2021, 1:27am UTC](https://discourse.haproxy.org/t/force-download-a-file-through-https/7044/3 "2021-11-03T01:27:01Z")

</div>

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](https://test.xxxxxxxxx.com.ve/example_file.pdf), I get this warning  
 ![chrome_error](https://us1.discourse-cdn.com/flex016/uploads/haproxy/original/2X/2/2631ec5bf20daa790b28260d8f6d5951cfa4a955.png)

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

---

<div class="post-metadata">

### Author: ![lukastribus](https://avatars.discourse-cdn.com/v4/letter/l/7ea924/32.png) [@lukastribus](https://discourse.haproxy.org/u/lukastribus)
#### Post date: [November 3, 2021, 4:36pm UTC](https://discourse.haproxy.org/t/force-download-a-file-through-https/7044/4 "2021-11-03T16:36:57Z")

</div>

Provide the output of

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