I'm working on sort of prototype project. I have two micro services hosted on separate server with different tech stack. Here are some of the endpoints of it
1 User management
    -- /users
    -- /user/:id
    -- /user/roles
2 Other operations (e.g. managing a book, book details)
    -- /books
    -- /book/:id
    -- /book/:id/history
I'm using GCP for hosting my apps. I have one load balancer pointing to above backend services. I'm trying to use Host and path rules to use both services and it looks like below screenshot.

I would like to access my User management micro service as
dns/user-manager/users
dns/user-manager/user/:id
dns/user-manager/user/roles
and other micro service as
dns/book-manager/books
dns/book-manager/book/:id
dns/book-manager/book/:id/history
but it looks like, it just forwarding above url to particular service directly, so I'm getting 404. And I don't want to add all my routes to load balancer path settings as it will be difficult to maintain. Looking forward to hear some solutions. Thanks in advance.
I understand you want inbound requests to /user-manager/SUB/PATH to be forwarded to user-service and re-written to /SUB/PATH. It sounds like you have got the forwarding to work, but not the rewriting.
Google HTTP/S LB can't do the re-writing for you. You will have to add a reverse-proxy between GCLB and your microservice to rewrite the URLs. For example nginx can do this.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With