<p>I have a Kubernetes Cluster set up. I am trying to set up an IngressRoute for traefik dashboard and I have been following this guide:</p>
<p><a href="https://blog.zachinachshon.com/traefik-ingress/" rel="nofollow noreferrer">https://blog.zachinachshon.com/traefik-ingress/</a></p>
<p>When I add the IngressRoute and Middleware I get the following errors on the traefik pod:</p>
<pre><code>time=&quot;2022-11-05T11:45:52Z&quot; level=error msg=&quot;error while parsing rule Host(\\`traefik.domain.com\\`) &amp;&amp; (PathPrefix(\\`/api\\`) || PathPrefix(\\`/dashboard\\`)): 1:6: illegal character U+005C '\\' (and 2 more errors)&quot; entryPointName=websecure routerName=traefik-traefik-dashboard-1cd33424d5fb33e10e2e@kubernetescrd
time=&quot;2022-11-05T11:45:52Z&quot; level=error msg=&quot;invalid rule Host(\\`traefik.domain.com\\`) &amp;&amp; (PathPrefix(\\`/api\\`) || PathPrefix(\\`/dashboard\\`)), error: 1:6: illegal character U+005C '\\' (and 2 more errors)&quot; routerName=traefik-traefik-dashboard-1cd33424d5fb33e10e2e@kubernetescrd entryPointName=websecure
</code></pre>
<p>I have tried changing the backtick to <code>'</code> and <code>&quot;</code> and tried adding and removing <code>\</code> before them with no luck.</p>
<p>yml:</p>
<pre class="lang-yaml prettyprint-override"><code>apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
  name: traefik-dashboard
  namespace: traefik
spec:
  entryPoints:
    - websecure
  routes:
    - kind: Rule
      match: Host(\`traefik.domain.com\`) &amp;&amp; (PathPrefix(\`/api\`) || PathPrefix(\`/dashboard\`))
      services:
        - name: api@internal
          kind: TraefikService
      middlewares:
        - name: traefik-dashboard-auth # Referencing the BasicAuth middleware
          namespace: traefik
  tls:
    secretName: domain-com-cert-secret
---
apiVersion: traefik.containo.us/v1alpha1
kind: Middleware
metadata:
  name: traefik-dashboard-auth
  namespace: traefik
spec:
  basicAuth:
    secret: traefik-dashboard-auth-secret

</code></pre>

Ross
<p>You need to wrap the entire rule in double quotes as per the <a href="https://doc.traefik.io/traefik/routing/routers/" rel="nofollow noreferrer">documentation</a>.</p>
<pre><code>match: &quot;Host(`traefik.domain.com`) &amp;&amp; (PathPrefix(`/api`) || mathPrefix(`/dashboard`))&quot;
</code></pre>
