<p>kubernetes ingress rules, AWS ALB rule has default path rule if no path is provided in the URL.
I couldn't figure out similar config in Traefik ingressroute.
<em>Right now - <a href="https://example.com" rel="nofollow noreferrer">https://example.com</a> goes to the default wildfly page.
<a href="https://example.com/foo" rel="nofollow noreferrer">https://example.com/foo</a> goes to the app login page.
How do I configure so that <a href="https://example.com" rel="nofollow noreferrer">https://example.com</a> would directly go to <a href="https://example.com/foo" rel="nofollow noreferrer">https://example.com/foo</a></em></p>
<pre><code>Ingressroute:
spec:
  entryPoints:
    - web
    - websecure
  routes:
  - kind: Rule
    match: Host(`example.com`) &amp;&amp; PathPrefix(`/`)
    middlewares:
      - name: https-redirect
        namespace: ns
    services:
    - name: service-1
      port: 80
</code></pre>
<p>Another ingressroute:</p>
<pre><code>spec:
  entryPoints:
    - web
  routes:
    - match: Host(`example.com`)
      kind: Rule
      middlewares:
        - name: https-redirect
      services:
        - name: service-1
          port: 80
</code></pre>
<p>Middleware:</p>
<pre><code>kind: Middleware
metadata:
  name: https-redirect
spec:
  redirectScheme:
    scheme: https
    permanent: true
</code></pre>

Chakaravarthy Natesan
<p>According to <code>Traefik</code> docs, you can create a typical <code>defaultBackend</code> Kubernetes <code>Ingress</code> like this:</p>
<pre><code>apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
 name: cheese

spec:
  defaultBackend:
    service:
      name: stilton
      port:
        number: 80
</code></pre>
<p>You can then set priority for this <code>Ingress</code> to ensure it matches the right type of requests, as <code>traefik.ingress.kubernetes.io/router.priority</code> annotation. You can read more about this <a href="https://doc.traefik.io/traefik/routing/providers/kubernetes-ingress/#global-default-backend-ingresses" rel="nofollow noreferrer">here</a>.</p>
