title: Traefik - proxy to backend with path
body: <p>i need to proxy <code>http://www.example.com/foo</code> to <code>http://&lt;backend&gt;/bar</code>, with nginx i have this configuration:</p>
  
  <pre><code>server {
      listen       80;
      client_max_body_size 2048M;
      server_name www.example.com;
      location /foo {
          proxy_pass      http://container_name/bar/;
          proxy_set_header Host            $host;
          proxy_set_header X-Forwarded-For $remote_addr;
      }
  }
  </code></pre>
  
  <p>I would convert this to traefik. there my compose file:</p>
  
  <pre><code>version: '3'
  services:
   traefik:
     image: traefik:1.7.3-alpine
     command: --api --docker
     ports:
      - "80:80"
      - "8080:8080"
     volumes:
      - /var/run/docker.sock:/var/run/docker.sock
     labels:
      - traefik.enable=false
  
   webapp:
     ...
     ...
     labels:
      - traefik.backend=bar
      - traefik.frontend.rule=Host:www.example.com;Path:/foo/
      - traefik.port=80
  </code></pre>
  
  <p>is there a way to solve?</p>
  
  <p>Thanks </p>