<p>I want to set up http to https redirect in one IngressRoute, but with configuration below when I trying to access http endpoint traefik returns 404 not found error. If I remove tls section redirect works but tls not. </p>

<p>Can I have both working?</p>

<p>traefik version 2.1.0-rc2</p>

<pre><code>apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
  name: console-web
  namespace: dev
  labels:
    app: console-web
spec:
  entryPoints:
    - web
    - websecure
  routes:
    - match: Host(`console.example.com`)
      kind: Rule
      services:
        - name: console-web
          port: 8080
      middlewares:
        - name: https-redirect
  tls:
    secretName: example-com-tls
</code></pre>

<p>This is an old issue however this might help someone. This might not directly work as i have not tested it. For kubernetes it should work in following way first you define how the middleware works</p>

<p><em>Untested Code</em></p>

<pre><code>apiVersion: traefik.containo.us/v1alpha1
kind: Middleware
metadata:
  name: test-redirectscheme
spec:
  redirectScheme:
    scheme: https
</code></pre>

<p>Then define the IngressRoute</p>

<pre><code>apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
  name: ingress1
  namespace: default
spec:
  entryPoints:
    - websecure
  routes:
    - match: Host(`somehost`)
      kind: Rule
      services:
        - name: console-web
          port: 8080
  tls:
    secretName: example-com-tls
</code></pre>

<pre><code>apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
  name: ingress2
  namespace: default
spec:
  entryPoints:
    - web
  routes:
    - match: Host(`somehost`)
      middlewares:
        - name: test-redirectscheme
      kind: Rule
      services:
        - name: console-web
          port: 80
</code></pre>

<p>two ingress needed as one is redirecting the trafic to other. I also suppose if you dont have two ports you can reuse the previous one as it is going to be redirected to https anyway. Let me know if it does not does not work. </p>

<p>after spending hours on this for docker on this 404 issue for the http endpoint i found this <a href="https://stackoverflow.com/a/62093408/2442649">https://stackoverflow.com/a/62093408/2442649</a></p>
