title: Host and Path with Traefik V2
body: <p>In reference to: <a href="https://stackoverflow.com/questions/44232354/define-host-and-path-frontend-rule-for-traefik">Define host and path frontend rule for Traefik</a> (I wanted to comment on the answer but I can't)</p>
  <p>I implemented the suggestion in the answer using</p>
  <pre><code>Host(`domain.com`) &amp;&amp; Path(`/path`)
  </code></pre>
  <p>but it does not work (Getting 404 when trying to access it).</p>
  <p>Traefik logs show:</p>
  <blockquote>
  <p>time=&quot;2020-07-07T10:31:30Z&quot; level=error msg=&quot;field not found, node: rule &quot; providerName=docker</p>
  </blockquote>
  <p>My docker compose looks like this:</p>
  <pre><code>deploy:
    labels:
      - &quot;traefik.enable=true&quot;
      - &quot;traefik.http.routers.typo3-${NAMEOFSERVICE}.rule = Host(`${HOSTNAME}`) &amp;&amp; Path(`${DIRECTORY}`)&quot;
  </code></pre>
  <p>When just using with the Host rule it works perfectly fine. But I want to be able to do e.g. <code>subdomain.domain.com/subdirectory</code> for service 1 and <code>subdomain.domain.com/subdirectory2</code> for service 2</p>
  <p>I also tried <code>- &quot;traefik.http.routers.typo3-${NAMEOFSERVICE}.rule = Host(`${HOSTNAME}`) &amp;&amp; PathPrefix(`${DIRECTORY}`)&quot;</code> but I get the same error in the log and 404.</p>