Traefik redirecting from https to https

My service superset is configured to redirect HTTP to HTTPS

image: superset:base
container_name: superset_app
  - '8080'
  - "traefik.enable=true"
  - "traefik.http.middlewares.http-to-https.redirectscheme.scheme=https"
  - "traefik.http.routers.superset-http.middlewares=http-to-https"
  - traefik.http.routers.superset-http.rule=Host("")
  - "traefik.http.routers.superset-http.entrypoints=web"
  - traefik.http.routers.superset.rule=Host("")
  - "traefik.http.routers.superset.entrypoints=web-secure"
  - "traefik.http.routers.superset.tls=true"
  - ""

This config works as expected.

curl -Ik
[1] 85007
HTTP/1.1 307 Temporary Redirect
Content-Length: 18
Content-Type: text/plain; charset=utf-8

But when I try to direct access by HTTPS, the request is redirected to http.

curl -Ik
[1] 85096
HTTP/1.1 302 Found
Content-Length: 209
Content-Type: text/html; charset=utf-8
Date: Mon, 26 Apr 2021 16:09:11 GMT
Server: Werkzeug/1.0.1 Python/3.6.9
HttpOnly; Path=/; SameSite=Lax
Vary: Cookie

Is there a problem with my traefik labels or is something in the application (superset)?

The problem isn't in traefik.
Apache superset use flask and X-Fowarded headers needed to be set in flask.

Here some explanation.

In the specific case of superset, just set ENABLE_PROXY_FIX=True in solve the issue.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.