Is there a way to create forwarding rules that redirect to a different host?
For example, I want to set up a load balancer with a rule that if the host = xyz.com
then forward to host = abc.com
Is this type of setup possible?
Is there a way to create forwarding rules that redirect to a different host?
For example, I want to set up a load balancer with a rule that if the host = xyz.com
then forward to host = abc.com
Is this type of setup possible?
Let me help you with this.
A forwarding rule and its corresponding IP address represent the frontend configuration of a Google Cloud load balancer.
Note: Forwarding rules are also used for protocol forwarding, Classic VPN gateways, and Traffic Director to provide forwarding information in the control plane.
Each forwarding rule references an IP address and one or more ports on which the load balancer accepts traffic. Some Google Cloud load balancers limit you to a predefined set of ports, and others let you specify arbitrary ports.
The forwarding rule also specifies an IP protocol. For Google Cloud load balancers, the IP protocol is always either TCP or UDP.
Depending on the load balancer type, the following is true:
A forwarding rule specifies a backend service, target proxy, or target pool.
A forwarding rule and its IP address are internal or external.
Also, depending on the load balancer and its tier, a forwarding rule is either global or regional.
As is mentioned the Forwarding rule specified a backed service which can help you to reach your deployment.
Additionally I want share with you the following information abiut the URL Mapping, which can help you too.
Google Cloud HTTP(S) load balancers and Traffic Director use a Google Cloud configuration resource called a URL map to route requests to backend services or backend buckets.
For example, with an external HTTP(S) load balancer, you can use a single URL map to route requests to different destinations based on the rules configured in the URL map:
Requests for https://example.com/video
go to one backend service.
Requests for https://example.com/audio
go to a different backend service.
Requests for https://example.com/images
go to a Cloud Storage backend bucket.
Requests for any other host and path combination go to a default backend service.
URL maps are used with the following Google Cloud products:
External HTTP(S) Load Balancing (global and regional)
Internal HTTP(S) Load Balancing
Traffic Director
There are two types of URL map resources available: global and regional. The type of resource that you use depends on the product's load balancing scheme.
HTTPS uses TLS (SSL) to encrypt HTTP requests and responses, making it safer and more secure. A website that uses HTTPS has https:// in the beginning of its URL instead of http://.
But I am not sure if the HTTP-to-HTTPS fits with your description.
I hope this information help you to chose the best option for your deployment.