Forwarding Rules in Vultr Load Balancer define how incoming traffic is directed to your backend servers. These rules allow you to specify a protocol, port, and target protocol/port for routing requests. By configuring forwarding rules, you can manage and optimize how traffic is distributed, enhancing the performance and accuracy of your load balancing setup.
Follow this guide to manage forwarding rules for your Vultr Load Balancer on your Vultr account using the Vultr Customer Portal, API, or CLI.
Navigate to Products and click Load Balancer.
Click your target Load Balancer to open its management page.
Click Configuration.
Click Forwarding Rules.
Click Add another rule and configure forwarding rules.
Click Save Changes.
Send a GET
request to the List Load Balancer endpoint and note the target Load Balancer's ID.
$ curl "https://api.vultr.com/v2/load-balancers" \
-X GET \
-H "Authorization: Bearer ${VULTR_API_KEY}"
Send a PATCH
request to the Update Load Balancer endpoint to add forwarding rules to the target Load Balancer.
$ curl "https://api.vultr.com/v2/load-balancers/<loadbalancer-id>/forwarding-rules" \
-X POST \
-H "Authorization: Bearer ${VULTR_API_KEY}" \
-H "Content-Type: application/json" \
--data '{
"frontend_protocol": "http",
"frontend_port": 8080,
"backend_protocol": "http",
"backend_port": 80
}'
List the available Load Balancers and note the target Load Balancer's ID.
$ vultr-cli load-balancer list
Add forwarding rules to the target Load Balancer.
$ vultr-cli load-balancer forwarding create <loadbalancer-id> --frontend-port 80 --frontend-protocol http --backend-port 80 --backend-protocol http