I am trying to achieve something simple yet I can't figure out why it isn't working.
I have two Cloud Run
function that are deployed independent from each other as two cloud run services. I want to access them from an external Load Balancer so that:
-example.com
takes me to the 1st function,
-example.com/api
takes me to the 2nd function
For above to happen I have written the following path rule in the Advanced host and path rule
part of Load Balancer
defaultService: projects/example-proj/global/backendServices/fun1
name: matcher1
routeRules:
- matchRules:
- prefixMatch: /api/*
priority: 1
routeAction:
weightedBackendServices:
- backendService: projects/example-proj/global/backendServices/fun2
weight: 100
With this setup I am able to access 1st function by going to example.com
, but going to example.com/api
gives me 404
error.