Learn how to create an HTTP/2 service with the OVHcloud Load Balancer solution. Here, we will configure this service to balance the load across several servers responding with HTTP/2.
The OVHcloud Load Balancer does not currently support the HTTP/2 protocol. However, you can bypass this restriction by using TCP mode with the ALPN extension of the TLS protocol.
ALPN (Application-Layer Protocol Negotiation) is a TLS extension that enables the application layer to negotiate which protocol will be used (h2 in this case).
Requirements
- a TCP front-end
- a TCP server cluster, with servers added to it
Instructions
Add a route
We will add a route to our service.
Via the API
- Service:
- POST /ipLoadbalancing/{serviceName}/tcp/route
- Settings:
-
serviceName
<Load Balancer ID>
action
type
"farm"
target
<ID of your TCP farm that must manage the HTTP/2>
frontendId
<ID of your front-end TCP 443>
Add a rule
We will now add a rule to our route.
Via the API
- Service:
- POST /ipLoadbalancing/{serviceName}/tcp/route/{routeId}/rule
- Settings:
-
serviceName
<Load Balancer ID>
routeId
<ID of the route created above>
field
"protocol"
match
"is"
pattern
"http/2.0"
Apply the modifications
The modifications made to your OVHcloud Load Balancer must be explicitly applied in each of the zones configured for your service. Only at this point will they be visible to your website visitors. This way, you can make complex configuration changes in one go.
If you have several zones, you must apply the same configuration for each of them.
Via the API
Refresh a zone:
- Service:
- POST /ipLoadbalancing/{serviceName}/refresh
- Settings:
-
serviceName *
<Load Balancer ID>
zone
<zone to deploy the configuration in>
Confirm
After you have completed all of these steps, you should have a functional load balancer service for your HTTP/2 servers. You can now confirm the status of your service by requesting it from your OVHcloud Load Balancer service, and then verifying the response version:
Go further
For more information and tutorials, please see our other OVHcloud Load Balancer guides or explore the guides for other OVHcloud products and services.