# Unable to securely(https) access the application with traefik in docker-compose

**URL:** <https://community.traefik.io/t/unable-to-securely-https-access-the-application-with-traefik-in-docker-compose/14599>\
**Category:** Traefik v1\
**Tags:** docker\
**Created:** [May 27, 2022, 3:48pm UTC](https://community.traefik.io/t/unable-to-securely-https-access-the-application-with-traefik-in-docker-compose/14599 "2022-05-27T15:48:31Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![kotianrakeshs](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/kotianrakeshs/32/5395_2.png) [@kotianrakeshs](https://community.traefik.io/u/kotianrakeshs)\
**Post date:** [May 27, 2022, 3:48pm UTC](https://community.traefik.io/t/unable-to-securely-https-access-the-application-with-traefik-in-docker-compose/14599/1 "2022-05-27T15:48:31Z")

</div>

My docker-compose file is as follows:

```auto
version: "2"
services:
  api:
    restart: always
    image: private_repo/middleware:2.0
    ports:
      - "7000:5000"
    volumes:
      - swagger-ui:/opt/www/app/templates
    labels:
      - "traefik.enable=true" 
      - "traefik.http.middlewares.redirect-middleware.redirectscheme.scheme=https"
      - "traefik.http.routers.api.entrypoints=frontendssl"
      - "traefik.http.routers.api.middlewares=redirect-to-https"
      - "traefik.http.routers.api.rule=Host(`traefik.cicd.dev`)"
      - "traefik.http.services.api.loadbalancer.server.port=7000"

  traefik:
    image: "traefik:v2.3"
    container_name: "traefik"
    command:
      - "--api.insecure=true"
      - "--api.dashboard=true"
      - "--api.debug=true"
      - "--log=true"
      - "--log.level=DEBUG"
      - "--entrypoints.frontend.address=:80"
      - "--entrypoints.frontendssl.address=:443"
      - "--entrypoints.frontendssl.http.tls=true"
      - "--providers.docker=true"
      - "--providers.docker.watch=true"
      - "--providers.docker.endpoint=unix:///var/run/docker.sock"
      - "--providers.docker.exposedbydefault=true"
      - "--providers.file.filename=/home/core/k8s_to_compose/traefik.yml"
      - "--providers.file.watch=true"
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.traefik.rule=Host(`traefik.cicd.dev`)"
      - "traefik.http.routers.traefik.entrypoints=frontendssl"
      - "traefik.http.routers.traefik.service=api@internal" 
      - "traefik.http.routers.traefik.middlewares=redirect-to-https"
      - "traefik.http.middlewares.redirect-to-https.redirectscheme.scheme=https"
      
    ports:
      - "80:80"
      - "443:443"
      - "8080:8080" 
    volumes:
      - "/var/run/docker.sock:/var/run/docker.sock:ro"
      - ./certs/:/home/core/k8s_to_compose/certs/:ro
      - ./traefik.yml:/home/core/k8s_to_compose/traefik.yml:ro

```

Here I have generated self signed certificates using openssl and also as I don't own a domain, so I have used `<vm-ip-address> traefik.cicd.dev`entry added into `/etc/hosts` .

Here issues what I observe is :

1. The traefik dashboard is not accessible with `https://traefik.cicd.dev:8080` but it can be accessed with `http://<vm-ip-address>:8080`
2. When I browse `https://traefik.cicd.dev:7000` to access my api container UI as in above docker-compose file, the chrome browser is showing: `This site can’t provide a secure connectiontraefik.cicd.dev sent an invalid response.ERR_SSL_PROTOCOL_ERROR`.  
But I can access when I browse with `http://<vm-ip-address>:7000`

Here Im trying get it working with https but could not achieve it. While debugging as suggested in community for similar issues, I have set `--api.insecure=true` as well, but no luck. Please help.
