Reverse proxy using consul catalog

Hello,

I would like to use traefik to route http calls from the gateway to the consul services.
My consul catalog is configured properly but I do not find any configuration to route the http calls to the services.

http://gateway.foobarqix.com/service_a/api/foobar should route api/foobar to the service_a service from consul.

The objective is to remove the nginx reverse proxy configuration such as:

server {
        listen 443 ssl http2;

        ssl_certificate /etc/letsencrypt/live/***;
        ssl_certificate_key /etc/letsencrypt/live/***;
        ssl_ciphers '***';
        ssl_prefer_server_ciphers on;
        ssl_dhparam /etc/ssl/certs/dhparam.pem;

        underscores_in_headers on;

        server_name gateway.foobarqix.com;

        location /service_a/ {
                add_header Strict-Transport-Security max-age=15768000;
                proxy_pass https://service_a.local/;
                proxy_set_header Host service_a.local;
                proxy_set_header X-Real-IP $remote_addr;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        }

        location /service_b/ {
                add_header Strict-Transport-Security max-age=15768000;
                proxy_pass https://service_b.local/;
                proxy_set_header Host service_b.local;
                proxy_set_header X-Real-IP $remote_addr;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        }

}

Any help?

Thanks in advance.

It almost works with the following configuration:

[providers.consulCatalog]
  refreshInterval = "30s"
  defaultRule = "PathPrefix(`/{{ .Name }}/`)"
  prefix = ""
  exposedByDefault = true

  [providers.consulCatalog.endpoint]
    address = "http://consul:8500"

Expect that requests are routed with the service name prefix.

Is it possible to strip a prefix globally? I do not want to add any labels to the actual docker containers.