<p>My problem is that my traefik ingress controller in my kubernetes cluster does response <code>404 page not found</code> over <code>http</code>, <strong>BUT</strong> over <code>https</code> I get the real response from the service.</p>

<p>This happened after I added the TLS section to <code>IngressRoute</code>.</p>

<p>This is my IngressRoute:  </p>

<pre><code>apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
  name: example-backend
  namespace: example
spec:
  entryPoints:
    - web
    - websecure
  routes:
  - match: Host(`api.example.com`)
    kind: Rule
    priority: 10
    services:
    - name: example-backend-service
      port: 80
  tls:
    secretName: tls-secret # I'm using my own certificate, not Let's Encrypt
</code></pre>

<p>Why I don't get the real/same response like <code>https</code> does?</p>

Emre Isik
<p>As the TLS applies on a router, you cannot have only one IngressRoute to handle the 2 cases.</p>

<pre><code>apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
  name: example-backend
  namespace: example
spec:
  entryPoints:
    - websecure
  routes:
  - match: Host(`api.example.com`)
    kind: Rule
    priority: 10
    services:
    - name: example-backend-service
      port: 80
  tls:
    secretName: tls-secret

---
apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
  name: example-backend-redirect
  namespace: example
spec:
  entryPoints:
    - web
  routes:
  - match: Host(`api.example.com`)
    kind: Rule
    priority: 10
    services:
    # in this IngressRoute the service will be never called
    # because of the redirect middleware.
    - name: example-backend-service
      port: 80
    middlewares:
    - name: https_redirect

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