# Cant redirect http to http. Also network error when using http2

**URL:** <https://discourse.haproxy.org/t/cant-redirect-http-to-http-also-network-error-when-using-http2/5385>\
**Category:** Help!\
**Created:** [June 25, 2020, 4:13am UTC](https://discourse.haproxy.org/t/cant-redirect-http-to-http-also-network-error-when-using-http2/5385 "2020-06-25T04:13:58Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![brijendrasial](https://avatars.discourse-cdn.com/v4/letter/b/3be4f8/32.png) [@brijendrasial](https://discourse.haproxy.org/u/brijendrasial)\
**Post date:** [June 25, 2020, 4:13am UTC](https://discourse.haproxy.org/t/cant-redirect-http-to-http-also-network-error-when-using-http2/5385/1 "2020-06-25T04:13:58Z")

</div>

Hello,

I have been testing haproxy and saw two issues.

First when I open site it doesnt redirect traffic to https.

Second, When I enable http2 mozilla browser shows network error and chrome error in ssl.

#---------------------------------------------------------------------

# FrontEnd Configuration

#---------------------------------------------------------------------  
frontend main  
bind \*:80  
option http-server-close  
option forwardfor

```
acl letsencrypt-acl path_beg /.well-known/acme-challenge/
use_backend letsencrypt-backend if letsencrypt-acl

#bind *:443 ssl crt /etc/letsencrypt/live/web.bullten.work/web.bullten.work.pem alpn h2,http/1.1 #combine letsencrypt cert.pem and private.pem file
bind *:443 ssl crt /etc/letsencrypt/live/web.bullten.work/web.bullten.work.pem

http-request redirect scheme https code 301 if ! letsencrypt-acl

default_backend app-main

```

# LE Backend

backend letsencrypt-backend  
server letsencrypt 127.0.0.1:8888

#---------------------------------------------------------------------

# BackEnd roundrobin as balance algorithm

#---------------------------------------------------------------------  
backend app-main  
balance roundrobin #Balance algorithm  
option httpchk HEAD / HTTP/1.1\r\nHost:\ localhost #Check the server application is up and healty - 200 status code  
server nginx1 192.0.0.1:443 check ssl verify none #Nginx1  
server nginx2 192.0.0.2:443 check ssl verify none #Nginx2  
server nginx3 192.0.0.3:443 check ssl verify none #Nginx3

listen stats

## HAProxy stats web gui.

```
    bind :9000
    mode http
    stats enable
    stats uri /haproxy_stats
    stats realm HAProxy Statistics
    stats auth haproxy:haproxy
    stats admin if TRUE
```

---

<div class="post-metadata">

**Author:** ![brijendrasial](https://avatars.discourse-cdn.com/v4/letter/b/3be4f8/32.png) [@brijendrasial](https://discourse.haproxy.org/u/brijendrasial)\
**Post date:** [June 25, 2020, 5:21am UTC](https://discourse.haproxy.org/t/cant-redirect-http-to-http-also-network-error-when-using-http2/5385/2 "2020-06-25T05:21:16Z")

</div>

http to https redirection issue solved. http2 issue is left

---

<div class="post-metadata">

**Author:** ![brijendrasial](https://avatars.discourse-cdn.com/v4/letter/b/3be4f8/32.png) [@brijendrasial](https://discourse.haproxy.org/u/brijendrasial)\
**Post date:** [June 25, 2020, 5:43am UTC](https://discourse.haproxy.org/t/cant-redirect-http-to-http-also-network-error-when-using-http2/5385/3 "2020-06-25T05:43:24Z")

</div>

all issues solved… thanks
