Load balanced sites can only be created on load balancer servers.To create a new load balanced site, navigate to the server’s dashboard, and click New site. Next, provide the name of the site, the balancing method and add the servers you want to balance the traffic to.
The selected servers must have a site with a matching domain, otherwise traffic will not be routed correctly. Forge domains (on-forge.com) are not available for load balancers.
Laravel Forge allows you to select one of three load balancer methods:
Round-robin - the default method, where requests are distributed evenly across all servers.
Least connections - requests are sent to the server with the least connections.
IP hash - the server to which a request is sent is determined by the client IP address. This means that requests from the same address are always handled by the same server unless it is unavailable.
Each server balanced by the load balancer can be configured with different weights, indicating that some servers should serve more traffic than others. For example, if you have two servers in your load balancer, one with a weight of 5 and the other with 1, then the first server would be sent five out of every six requests made to the load balancer.
Individual servers can be marked as a backup. Backup servers will receive no traffic unless all other servers managed by the load balancer are not responding.
You may pause traffic to a specific server being managed by the balancer. While paused, the selected server will no longer serve incoming traffic. You may unpause the server at any time.
Typically, SSL certificates are installed on the individual application servers. However, when using load balancing, the certificate should be configured on the load balancer itself. You should consult the SSL documentation for more information on managing SSL certificates for your servers, including load balancers.When using SSL on a load balancer, you will likely need to configure the “trusted proxies” for your application. For Laravel applications, consult the trusted proxies documentation.
Was this page helpful?
Assistant
Responses are generated using AI and may contain mistakes.