Closed jialechan closed 1 month ago
It looks like the connection is established but there isn't a route at the path you requested 🤔
It looks like the connection is established but there isn't a route at the path you requested 🤔
@kayx23 Thank you for your reply. I have done it again using the following method.
apiVersion: apps/v1
kind: Deployment
metadata:
name: httpbin
labels:
app: default
spec:
replicas: 1
selector:
matchLabels:
app: httpbin
template:
metadata:
labels:
app: httpbin
spec:
containers:
- name: httpbin
image: kennethreitz/httpbin:latest
ports:
- containerPort: 80
---
apiVersion: v1
kind: Service
metadata:
name: httpbin
spec:
selector:
app: httpbin
ports:
- name: httpbin
protocol: TCP
port: 80
targetPort: 80
---
apiVersion: apisix.apache.org/v2
kind: ApisixRoute
metadata:
name: httpbin
namespace: default
spec:
http:
- backends:
- serviceName: httpbin
servicePort: 80
match:
paths:
- /*
name: route1
Not working, expected to be http2, resulting in http1.1
🤔 I am not sure at the moment but can confirm this behaviour is reproducible and does not have anything to do with the installation method.
🤔 I am not sure at the moment but can confirm this behaviour is reproducible and does not have anything to do with the installation method.
Apisix should enable http2 by default(https://github.com/apache/apisix/issues/8989), but I cannot reproduce this feature and I don't know where the problem lies. ðŸ˜
@jialechan maybe this issue is because the httpbin server doesn't support http2?
@jialechan maybe this issue is because the httpbin server doesn't support http2?
@shreemaan-abhishek Thank you for your reply. I replace httpbin to something support http2, but it is not working too:
Step 1: create apisix
helm install apisix apisix/apisix --create-namespace --namespace ingress-apisix --set etcd.persistence.size=20Gi --set ingress-controller.enabled=true --set etcd.persistence.storageClass=alicloud-disk-essd
Step 2: create test service
apiVersion: v1
kind: Endpoints
metadata:
name: my-test
subsets:
- addresses:
- ip: 139.162.123.134 # nghttp2.org
ports:
- name: my-test
port: 80
protocol: TCP
---
apiVersion: v1
kind: Service
metadata:
name: my-test
spec:
ports:
- name: my-test
port: 80
protocol: TCP
---
apiVersion: apisix.apache.org/v2
kind: ApisixRoute
metadata:
name: my-test
namespace: default
spec:
http:
- backends:
- serviceName: my-test
servicePort: 80
match:
paths:
- /*
name: route1
Step 3: test result
It seems that http2 can be used to access the service directly, but it cannot be used after forwarding through apisix.
can you confirm if http2 is enabled? https://github.com/apache/apisix-helm-chart/blob/38ed5919ecf49d84230b123b5551bf8c782398ea/charts/apisix/templates/configmap.yaml#L76
can you confirm if http2 is enabled? https://github.com/apache/apisix-helm-chart/blob/38ed5919ecf49d84230b123b5551bf8c782398ea/charts/apisix/templates/configmap.yaml#L76
@shreemaan-abhishek Thank you for your reply.
As shown in the figure, this is my configuration. It seems that http2 has been enabled. apisix also enable http2 by default.
@shreemaan-abhishek Thank you for your reply.
i am try to deploy apisix by docker, and h2c not wokring too:
step one: setup apisix by docker
docker run -d --name apache-apisix \
-p 9080:9080 \
-e APISIX_STAND_ALONE=true \
apache/apisix
stop two: setup route
docker exec -i apache-apisix sh -c 'cat > /usr/local/apisix/conf/apisix.yaml <<_EOC_
routes:
-
id: httpbin
uri: /*
upstream:
nodes:
"nghttp2.org": 1
type: roundrobin
#END
_EOC_'
step three: test
curl -I --http2 http://localhost:9080
curl -I --http2 http://nghttp2.org
apisix h2c not working...
I have identified the root cause of the issue. Currently, nginx(after 1.25) only supports http1.1 or http2 when using HTTP (without TLS configuration), and does not support upgrading from http1.1 to http2
Current Behavior
Install apisix by helm, apisix's http2 not working by default
Expected Behavior
apisix's http2 should working by default
Error Logs
No response
Steps to Reproduce
install apisix by helm
Get the application URL
test by curl
Environment
apisix version
): 3.9.1uname -a
):Linux apisix-55cbb7f44c-xglgc 5.10.134-17.1.al8.x86_64 #1 SMP Wed Jul 10 15:35:22 CST 2024 x86_64 GNU/Linux
openresty -V
ornginx -V
): nginx version: openresty/1.25.3.1 built by gcc 10.2.1 20210110 (Debian 10.2.1-6) built with OpenSSL 3.2.0 23 Nov 2023 TLS SNI support enabled configure arguments: --prefix=/usr/local/openresty/nginx --with-cc-opt='-O2 -DAPISIX_RUNTIME_VER=1.2.0 -DNGX_GRPC_CLI_ENGINE_PATH=/usr/local/openresty/libgrpc_engine.so -DNGX_HTTP_GRPC_CLI_ENGINE_PATH=/usr/local/openresty/libgrpc_engine.so -DNGX_LUA_ABORT_AT_PANIC -I/usr/local/openresty/zlib/include -I/usr/local/openresty/pcre/include -I/usr/local/openresty/openssl3/include' --add-module=../ngx_devel_kit-0.3.3 --add-module=../echo-nginx-module-0.63 --add-module=../xss-nginx-module-0.06 --add-module=../ngx_coolkit-0.2 --add-module=../set-misc-nginx-module-0.33 --add-module=../form-input-nginx-module-0.12 --add-module=../encrypted-session-nginx-module-0.09 --add-module=../srcache-nginx-module-0.33 --add-module=../ngx_lua-0.10.26 --add-module=../ngx_lua_upstream-0.07 --add-module=../headers-more-nginx-module-0.37 --add-module=../array-var-nginx-module-0.06 --add-module=../memc-nginx-module-0.20 --add-module=../redis2-nginx-module-0.15 --add-module=../redis-nginx-module-0.3.9 --add-module=../ngx_stream_lua-0.0.14 --with-ld-opt='-Wl,-rpath,/usr/local/openresty/luajit/lib -Wl,-rpath,/usr/local/openresty/wasmtime-c-api/lib -L/usr/local/openresty/zlib/lib -L/usr/local/openresty/pcre/lib -L/usr/local/openresty/openssl3/lib -Wl,-rpath,/usr/local/openresty/zlib/lib:/usr/local/openresty/pcre/lib:/usr/local/openresty/openssl3/lib' --add-module=/tmp/tmp.EQbG5FbABp/openresty-1.25.3.1/../mod_dubbo-1.0.2 --add-module=/tmp/tmp.EQbG5FbABp/openresty-1.25.3.1/../ngx_multi_upstream_module-1.2.0 --add-module=/tmp/tmp.EQbG5FbABp/openresty-1.25.3.1/../apisix-nginx-module-1.16.0 --add-module=/tmp/tmp.EQbG5FbABp/openresty-1.25.3.1/../apisix-nginx-module-1.16.0/src/stream --add-module=/tmp/tmp.EQbG5FbABp/openresty-1.25.3.1/../apisix-nginx-module-1.16.0/src/meta --add-module=/tmp/tmp.EQbG5FbABp/openresty-1.25.3.1/../wasm-nginx-module-0.7.0 --add-module=/tmp/tmp.EQbG5FbABp/openresty-1.25.3.1/../lua-var-nginx-module-v0.5.3 --add-module=/tmp/tmp.EQbG5FbABp/openresty-1.25.3.1/../grpc-client-nginx-module-v0.5.0 --add-module=/tmp/tmp.EQbG5FbABp/openresty-1.25.3.1/../lua-resty-events-0.2.0 --with-poll_module --with-pcre-jit --with-stream --with-stream_ssl_module --with-stream_ssl_preread_module --with-http_v2_module --with-http_v3_module --without-mail_pop3_module --without-mail_imap_module --without-mail_smtp_module --with-http_stub_status_module --with-http_realip_module --with-http_addition_module --with-http_auth_request_module --with-http_secure_link_module --with-http_random_index_module --with-http_gzip_static_module --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_mp4_module --with-http_gunzip_module --with-threads --with-compat --with-stream --without-pcre2 --with-http_ssl_module