HTTP/1.0 and HTTP/0.9
Configure your gateway proxy to accept older HTTP protocols.
About HTTP/1.0 and HTTP/0.9
By default, Envoy-based gateway proxies return a 426 Upgrade Required HTTP response code for HTTP/1.0 and HTTP/0.9 requests. HTTP/0.9 was a simple, rudimentary protocol that was introduced in 1991 and supported only the GET
HTTP method. Other methods, such as POST
, PUT
, and DELETE
were later introduced in HTTP/1.0.
Both protocol versions are rarely used nowadays. However, some applications might still require support for these versions for backwards compatibililty. To allow the gateway proxy to accept these types of requests, you can create an HTTPListenerPolicy and attach it to your Gateway.
Before you begin
-
Follow the Get started guide to install kgateway.
-
Deploy a sample httpbin app.
-
Decide whether to set up a listener inline on the Gateway resource or as a separate ListenerSet resource. For more information, see the Listener overview.
ListenerSets: This feature is available in kgateway version 2.1.x or later. Also, you must install the experimental channel of the Kubernetes Gateway API at version 1.3 or later.
Set up HTTP 1.0 support
-
Create an HTTPListenerPolicy with the
acceptHttp10
field. In thetargetRefs
, attach the policy to the Gateway that you want to support the HTTP/1.0 protocol.kubectl apply -f- <<EOF apiVersion: gateway.kgateway.dev/v1alpha1 kind: HTTPListenerPolicy metadata: name: accept-http10 namespace: kgateway-system spec: targetRefs: - group: gateway.networking.k8s.io kind: Gateway name: http acceptHttp10: true EOF
-
Port-forward the gateway proxy on port 19000 to open the Envoy admin interface.
kubectl port-forward deploy/http -n kgateway-system 19000
-
Open the Envoy admin interface and look for the
http_protocol_options
filter in your Envoy filter chain. Then, verify that theaccept_http_10
field is set totrue
.Example output:
"http_protocol_options": { "accept_http_10": true }
Cleanup
You can remove the resources that you created in this guide.kubectl delete httplistenerpolicy accept-http10 -n kgateway-system