All Products
Search
Document Center

Microservices Engine:http2-misdirect

Last Updated:Oct 24, 2023

The http2-misdirect plug-in is used to resolve issues such as the HTTP status code 404 returned due to browser connection reuse when HTTP/2 is enabled for gateways.

Plug-in type

Transfer protocol-related plug-in.

Implementation principle

The HTTP/2 protocol allows two requests from different domain names to reuse the same connection if the domain names are resolved to the same IP address and the same certificate is used. In some special scenarios, requests that reuse the same connection are not sent to the valid virtual host for processing. As a result, the HTTP status code 404 is returned. After you enable the http2-misdirect plug-in, if the plug-in detects that the Server Name Indication (SNI) in the request does not match the current virtual host, the HTTP status code 421 is returned to force the browser to establish a new connection. The plug-in generates a matched SNI based on the domain name in the request. This way, the gateway can correctly route the request.

Browser compatibility

Safari versions earlier than 15.1 do not support the HTTP status code 421. If a client uses one of these Safari versions, we recommend that you disable HTTP/2 Application-Layer Protocol Negotiation (ALPN) for the specified domain name.