Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

http to https redirect not working ? #6737

Closed
HuntiXz opened this issue Apr 27, 2020 · 1 comment
Closed

http to https redirect not working ? #6737

HuntiXz opened this issue Apr 27, 2020 · 1 comment

Comments

@HuntiXz
Copy link

HuntiXz commented Apr 27, 2020

Do you want to request a feature or report a bug?

Bug

What did you do?

I deployed a basic setup for traefik to test the migration from 1.7.x to 2.2.0. However the 2.2.0 new feature of redirecting http to https does not seem to work as I expected.

What did you expect to see?

When you go to http://dashboard.internal.domain.com I end up on https://dashboard.internal.domain.com

What did you see instead?

I stay on the http endpoint not https.

Although when I uncomment - traefik.http.routers.dashboard.middlewares=redirect-web-to-websecure@internal it works

Output of traefik version: (What version of Traefik are you using?)

latest

What is your environment & configuration (arguments, toml, provider, platform, ...)?

traefik stack:

version: "3.6"
services:
  node:
    image: traefik:latest
    networks:
      - public
    ports:
      - target: 80
        published: 80
        protocol: tcp
        mode: host
      - target: 443
        published: 443
        protocol: tcp
        mode: host
      - target: 8080
        published: 8080
        protocol: tcp
        mode: host
    deploy:
      mode: global
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro
      - node_data:/etc/traefik/
    configs:
      - source: traefik_config_20200426_04
        target: /etc/traefik/traefik.yml
      - source: traefik_htpasswd_20200422_00
        target: /etc/traefik/.htpasswd
    environment:
      - DO_AUTH_TOKEN=${DIGITALOCEAN_AUTH_TOKEN}
    command: traefik --configFile=/etc/traefik/traefik.yml
networks:
  public:
    external: true
volumes:
  node_data:
configs:
  traefik_config_20200426_04:
    external: true
  traefik_htpasswd_20200422_00:
    external: true

traefik config:

global:
  checkNewVersion: true

providers:
  docker:
    network: public
    endpoint: unix:///var/run/docker.sock
    swarmMode: true
    exposedByDefault: false
  file:
    directory: /etc/traefik/dynamic

entryPoints:
  web:
    address: :80
    http:
      redirections:
        entryPoint:
          to: websecure
          scheme: https

  websecure:
    address: :443
    http:
      tls:
        certResolver: default
        domains:
          - main: "internal.domain.com"
            sans:
              - "*.internal.domain.com"

api:
  insecure: true
  dashboard: true
  debug: true

log:
  level: INFO

certificatesResolvers:
  default:
    acme:
      email: certificates@domain.com
      storage: /etc/traefik/acme.json
      dnsChallenge:
        provider: digitalocean

dashboard stack:

version: '3.3'
services:
  node:
    image: charypar/swarm-dashboard:latest
    environment:
      PORT: '8080'
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro
    networks:
      - public
    deploy:
      replicas: 1
      labels:
        - traefik.enable=true
        - traefik.http.routers.dashboard.rule=Host(`dashboard.internal.domain.com`)
#        - traefik.http.routers.dashboard.middlewares=redirect-web-to-websecure@internal
        - traefik.http.services.dashboard.loadbalancer.server.port=8080
      placement:
        constraints:
          - node.role == manager
networks:
  public:
    external: true
@ldez
Copy link
Member

ldez commented Apr 28, 2020

Thank you, it's already fixed by #6588

@ldez ldez closed this as completed Apr 28, 2020
@traefik traefik locked and limited conversation to collaborators Jul 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants