i'm trying to do an rewrite in an GCP external LB url map which does the following:
domain2/foo/bar/cat.json
should be reachable via:
domain1/baz/cat.json
In terraform i tried it like this, using the hashicorp google provider version 4.39.0.
path_matcher {
name = "domain1-matcher"
default_service = domain1.service
path_rule {
paths = ["/baz/"]
service = domain1.service
route_action {
url_rewrite {
host_rewrite = "domain2"
path_prefix_rewrite = "/foo/bar/"
}
}
}
}
So basically I want to replace some part of the path with another one. This is working fine. But i'm not able to serve the contents from domain2 while showing domain1 in the browser url . Seems that host_rewrite does not that I want. How can I achieve an real host rewrite?
Thanks in advance