Traefik 2.0: Route GRPC Request based on url

Hi every body
i have suggestion for routing gRPC requests in V2.0
i reported it as issue
Please check it.
Thanks in advance.

can route gRPC request for variable urls
for instance : for invoke service1 for invoke service2

in current implementation for example this proto

syntax = "proto3";

option java_multiple_files = true;
option java_package = "io.grpc.examples.helloworld";
option java_outer_classname = "HelloWorldProto";
option objc_class_prefix = "HLW";

package helloworld;

// The greeting service definition.
service Greeter {
  // Sends a greeting
  rpc SayHello (HelloRequest) returns (HelloReply) {}

// The request message containing the user's name.
message HelloRequest {
  string name = 1;

// The response message containing the greetings
message HelloReply {
  string message = 1;

its better to be called by url:

For this proto every request will have attributes like :
url path : /helloworld.Greeter/SayHello

as in docs available matchers for this scenario are

  1. host, HostRegexp
  2. Path, PathPrefix

HostRegexp can be used for segregate urls but there is a problem with this approach.

traefik use containous fork on gorilla/mux and in

// getHost tries its best to return the request host.
func getHost(r *http.Request) string {
	if r.URL.IsAbs() {
		return r.URL.Host
	host := r.Host
	// Slice off any port information.
	if i := strings.Index(host, ":"); i != -1 {
		host = host[:i]
	return host


urls after colon : will be truncated before check regexp.
My suggestion is use other option for check whole url for routing rule.
something like grpc url or just Url and UrlRegexP.
BTW: In gRPC request host variable holds host and path and name Host for url is somehow misleading.


You just need to combined Host and Path:

Host(``) && Path(`/hello/world`)