I have a load balancer (LB) in GCP that is currently redirecting some matching paths to an external (non-GCP) service (301 Redirect). I am trying to add additional set of prefixMatch rules that will instead act as a reverse proxy to a separate 3rd party service (WebFlow, in case it matters).
I have a backend service (external) that uses an NEG that points to the fully qualified domain of the 3rd party host [mysite.webflow.io]. I have the rules set up to use that service for 2 paths (/blog/, /pages/).
After updating the LB routing rules with the following YAML, the priority 1 rules are still working, but the priority 2 rules (the proxy) are pointing to the 404 page found in my default service.
Hosts: mysite.com, www.mysite.com
defaultService: projects/my-gcp-project-1/global/backendServices/my-default-service
name: redirect-rules
routeRules:
- urlRedirect:
hostRedirect: subdomain.mysite.com
redirectResponseCode: MOVED_PERMANENTLY_DEFAULT
matchRules:
- prefixMatch: /rad-page-1
- prefixMatch: /rad-page-2
priority: 1
- matchRules:
- prefixMatch: /pages/*
- prefixMatch: /blog/*
priority: 2
routeAction:
weightedBackendServices:
- backendService: projects/my-gcp-project-1/global/backendServices/proxy-backend-service
weight: 100
urlRewrite:
hostRewrite: www.mysite.com
I'm wondering if I'm missing something like preserveHost: true?
I'm new to setting up rules like this in GCP. Thanks in advance for the help!