You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by "singhajitk (via GitHub)" <gi...@apache.org> on 2026/02/11 03:51:32 UTC

[I] bug: HTTP2 protocol not working when ApisixUpstream scheme is set to https [apisix]

singhajitk opened a new issue, #13002:
URL: https://github.com/apache/apisix/issues/13002

   ### Current Behavior
   
   ### Issue Description
   HTTP2 protocol is not working when `ApisixUpstream` spec `scheme` is set to `https`. The upstream connection does not utilize HTTP2 even though the backend service supports it.
   
   
   ### Actual Behavior
   - ApisixUpstream is configured with `scheme: https`
   - HTTP2 protocol is not being used for upstream connections
   - Traffic defaults to HTTP/1.1 instead of HTTP2
   - No HTTP2 negotiation occurs despite backend service supporting HTTP2
   
   ### Expected Behavior
   
   ### Expected Behavior
   When `scheme: https` is configured in ApisixUpstream, APISIX should automatically negotiate and use HTTP2 protocol for upstream connections if the backend service supports it via ALPN (Application-Layer Protocol Negotiation).
   
   ### Error Logs
   
   ### No specific errors
   
   ### Steps to Reproduce
   
   ### Steps to Reproduce
   1. Create an ApisixUpstream resource with `scheme: https`
   2. Configure a backend service that supports HTTP2 over TLS
   3. Send requests through APISIX to the upstream
   4. Observe protocol being used (HTTP/1.1 instead of HTTP2)
   
   ### Configuration Example
   
   ```yaml
   apiVersion: apisix.apache.org/v2
   kind: ApisixUpstream
   metadata:
     name: example-apisixupstream
   spec:
     scheme: https
     discovery:
       type: kubernetes
       serviceName: namespace/service-name:http
     retries: 0
     timeout:
       connect: 150s
       send: 150s
       read: 150s
   
   ### Environment
   
   - APISIX version (run `apisix version`):  3.13.0
   - Operating system (run `uname -a`): Linux apisix-data-plane-567765b759-6np8s 6.8.0-87-generic #88~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Tue Oct 14 14:03:14 UTC 2 x86_64 GNU/Linux
   - OpenResty / Nginx version (run `openresty -V` or `nginx -V`):  nginx version: openresty/1.27.1.2 built with OpenSSL 3.4.1 11 Feb 2025
   - etcd version, if relevant (run `curl [http://127.0.0.1:9090/v1/server_info`):](http://127.0.0.1:9090/v1/server_info%60):)  3.6.0
   - APISIX Dashboard version, if relevant:  3.0.1
   - Plugin runner version, for issues related to plugin runners: 
   - LuaRocks version, for installation issues (run `luarocks --version`):  3.12.0
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] bug: HTTP2 protocol not working when ApisixUpstream scheme is set to https [apisix]

Posted by "singhajitk (via GitHub)" <gi...@apache.org>.
singhajitk commented on issue #13002:
URL: https://github.com/apache/apisix/issues/13002#issuecomment-3888712749

   > The scheme only affects encryption, not the protocol version. APISIX's Nginx template hardcodes `proxy_http_version 1.1`. Only gRPC supports HTTP/2.
   
   Thanks @Baoyuantop for your response.  
   
   I have observed that HTTP2 Upstream protocol was working when I set scheme value to "grpcs", but the backend service was not gRPC enabled. It was a simple http based rest api served using .net kestrel server.  
   
   Do we know how HTTP2 is working with scheme set as "grpcs" even when the upstream service is not supporting gRPC ?
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] bug: HTTP2 protocol not working when ApisixUpstream scheme is set to https [apisix]

Posted by "singhajitk (via GitHub)" <gi...@apache.org>.
singhajitk commented on issue #13002:
URL: https://github.com/apache/apisix/issues/13002#issuecomment-3888824603

   > This is not currently supported. Could you describe your scenario? Are you seeking client-to-gateway support or gateway-to-upstream support?
   
   We are looking for gateway-to-upstream support.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] bug: HTTP2 protocol not working when ApisixUpstream scheme is set to https [apisix]

Posted by "Baoyuantop (via GitHub)" <gi...@apache.org>.
Baoyuantop commented on issue #13002:
URL: https://github.com/apache/apisix/issues/13002#issuecomment-3888494925

   The scheme only affects encryption, not the protocol version. APISIX's Nginx template hardcodes `proxy_http_version 1.1`. Only gRPC supports HTTP/2.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] bug: HTTP2 protocol not working when ApisixUpstream scheme is set to https [apisix]

Posted by "singhajitk (via GitHub)" <gi...@apache.org>.
singhajitk commented on issue #13002:
URL: https://github.com/apache/apisix/issues/13002#issuecomment-3961936053

   Thank you @Baoyuantop for the information and adding this as a feature request.  


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] bug: HTTP2 protocol not working when ApisixUpstream scheme is set to https [apisix]

Posted by "Baoyuantop (via GitHub)" <gi...@apache.org>.
Baoyuantop commented on issue #13002:
URL: https://github.com/apache/apisix/issues/13002#issuecomment-3956299895

   Hi @singhajitk, thank you for your detailed report and for clarifying that you are looking for gateway-to-upstream HTTP/2 support.
   
   I'd like to clarify the current behavior. The `scheme: https` setting in the `ApisixUpstream` resource is designed to enable TLS encryption for the connection to the upstream service. It does not, by itself, alter the application-layer protocol, which defaults to HTTP/1.1 for standard proxying. This is why you are observing HTTP/1.1 being used.
   
   Your observation that setting the scheme to `grpcs` enables HTTP/2 is interesting. This happens because the `grpcs` scheme forces APISIX to configure the connection for gRPC, which inherently uses HTTP/2. While this may appear to work with a non-gRPC backend that supports HTTP/2 over TLS, it is an unintended side effect and not a supported configuration for standard HTTP services. Relying on this could lead to unexpected behavior as it bypasses logic intended for regular HTTP traffic.
   
   True support for HTTP/2 to a generic HTTPS upstream is currently not available as a direct feature. We recognize this as a valuable enhancement. We will treat this as a feature request to add a dedicated option to enable HTTP/2 for upstream connections explicitly, perhaps through a new field in the `ApisixUpstream` spec.
   
   We appreciate you bringing this to our attention. Please feel free to follow the issue for updates, and we welcome any contributions from the community to help implement this feature.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] bug: HTTP2 protocol not working when ApisixUpstream scheme is set to https [apisix]

Posted by "Baoyuantop (via GitHub)" <gi...@apache.org>.
Baoyuantop commented on issue #13002:
URL: https://github.com/apache/apisix/issues/13002#issuecomment-3888805407

   This is not currently supported. Could you describe your scenario? Are you seeking client-to-gateway support or gateway-to-upstream support?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org