I cannot figure out how to get a simple service to be accessible by both http and https on localhost. This is my setup so far and I'm using traefik V2.xxx.
I want to be able to hit this site using both https/http protocols (for reasons on dev machines only). The https works just fine but http does NOT. What labels do I need to add/remove/change?
http://whoami.localhost:8000/
https://whoami.localhost:8443/
docker-compose.yml
version: "3.7"
services:
whoami:
image: containous/whoami
labels:
- traefik.enable=true
- traefik.http.routers.whoami.rule=Host(`whoami.localhost`)
- traefik.http.routers.whoami.entrypoints=web,web-secure
- traefik.http.routers.whoami.tls=true
- traefik.protocol=http,https
reverse-proxy:
depends_on:
- whoami
image: traefik:v2.1.1
ports:
- 8000:80
- 8443:443
- 8001:8080
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ./traefik:/etc/traefik:ro
traefik/traefik.toml
[log]
level = "DEBUG"
[accessLog]
filePath = "/logs/access.log"
bufferingSize = 20
[docker]
exposedbydefault = false
[api]
dashboard = true
insecure = true
[providers]
[providers.file]
filename = "/etc/traefik/traefik.toml"
watch = true
[providers.docker]
exposedbydefault = false
[[tls.certificates]]
certFile = "/etc/traefik/certs/localhost-cert.pem"
keyFile = "/etc/traefik/certs/localhost-key.pem"
[entryPoints]
[entryPoints.web]
address = ":80"
[entryPoints.web-secure]
address = ":443"
C:\Windows\System32\drivers\etc\hosts
127.0.0.1 whoami.localhost