# Redirect http to http2, unable to get it working

**URL:** <https://community.traefik.io/t/redirect-http-to-http2-unable-to-get-it-working/4161>\
**Category:** Traefik v2\
**Tags:** middleware\
**Created:** [January 29, 2020, 12:32pm UTC](https://community.traefik.io/t/redirect-http-to-http2-unable-to-get-it-working/4161 "2020-01-29T12:32:18Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rogier](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/rogier/32/1514_2.png) [@rogier](https://community.traefik.io/u/rogier)\
**Post date:** [January 29, 2020, 12:32pm UTC](https://community.traefik.io/t/redirect-http-to-http2-unable-to-get-it-working/4161/1 "2020-01-29T12:32:18Z")

</div>

I'm migrating my (home server) version 1 to version 2 of traefik. I run my services in docker, so I'm mounting the docker socket into traefik. So far so good. Here is my traefik config file:

```auto
 log:
   level: DEBUG
 
 entryPoints:
   http:
     address: :80
   https:
     address: :443
 
 certificatesResolvers:
   letsEncrypt:
     acme:
       email: xxxxxxx
       storage: /etc/traefik/acme/acme.json
       httpChallenge:
         # used during the challenge
         entryPoint: http
 
 providers:
   docker:
     endpoint: unix:///var/run/docker.sock
     exposedByDefault: false

```

Now, when I start a container, I use this:

```auto
docker run --name=test \
            --expose 80 \
            --rm \
            -l "traefik.enable=true" \
            -l "traefik.http.routers.whoami.rule=Host(\"test.xxxxxx.com\")" \
            -l "traefik.http.routers.whoami.tls=true" \
            -l "traefik.http.routers.whoami.tls.certresolver=letsEncrypt" \
            -l "traefik.http.routers.whoami.service=whoami" \
            -l "traefik.http.services.whoami.loadbalancer.server.port=80" \
            containous/whoami

```

This works, but only when I directly go to [https://test.xxxxxx.com](https://test.xxxxxx.com). When I go to [http://test.xxxxx.com](http://test.xxxxx.com), I get a 404. I tried a lot of things, but for some reason I can't get it to work. Can someone please point me in the correct direction?

I prefer to have this automatic redirect to setup globally (so not per container), but I understood this is not possible in V2?

---

<div class="post-metadata">

**Author:** ![ldez](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/ldez/32/5_2.png) [@ldez](https://community.traefik.io/u/ldez)\
**Post date:** [February 1, 2020, 11:10pm UTC](https://community.traefik.io/t/redirect-http-to-http2-unable-to-get-it-working/4161/2 "2020-02-01T23:10:37Z")

</div>

Hello,

Take a look to:

- [https://docs.traefik.io/v2.1/migration/v1-to-v2/#http-to-https-redirection-is-now-configured-on-routers](https://docs.traefik.io/v2.1/migration/v1-to-v2/#http-to-https-redirection-is-now-configured-on-routers)
- [https://blog.containo.us/traefik-2-0-docker-101-fc2893944b9d](https://blog.containo.us/traefik-2-0-docker-101-fc2893944b9d)
- [https://github.com/containous/blog-posts/tree/master/2019\_09\_10-101\_docker](https://github.com/containous/blog-posts/tree/master/2019_09_10-101_docker)
