[Part 2] How to configure URL redirection with GCP's global external HTTP(S) load balancer
Hello!
My name is Hide, the ramen king of Beyond Osaka Office.
This is my 9th post.
Last time, I wrote about how to configure URL redirection using GCP's Google Cloud Load Balancing (GCLB) global external HTTP(S) load balancer (traditional)!
This time, continuing from the previous article, I will write about how to configure URL redirection using GCLB's global external HTTP(S) load balancer.
It's a little more difficult than the traditional method, but let's do our best together.
*If you are interested in traditional URL redirect settings, please take a look at the article below!
Setting procedure
*This assumes that you have created a load balancer (LB).
① Load balancing > LB name > Click Edit
② Select detailed host and path rules and click [Add host and path rules]
③ Specify the redirect source domain with new host and path rules
④ Set redirection and click [Update]
*URL redirect setting official document
defaultService: global/backendServices/backend name name: matcher1 *Specify a name of your choice routeRules: - urlRedirect: stripQuery: true *Whether to delete the query hostRedirect: test2.com *Specify the redirect destination matchRules: - prefixMatch: / *Specify the path to be redirected priority: 0 *0 has the highest priority
⑤ Operation check
*Please do this after the LB update is complete.
*Please check if you are redirected.
↓
summary
What do you think?
Traditional global HTTP(S) load balancers are easy to set up redirects, but global HTTP(S) load balancers are coded, which can be confusing.
However, if you can properly set up redirects with a load balancer, you can do it without putting any load on the server, so it is recommended.
If you want to set up redirection with GCP's LB, please use this as a reference!