proxy-write and grpc-web not work together #8302
-
I'm trying to make two routes and two upstream grpc service work like this:
Since I saw this issue said the route path should be consistent with the uri provided by the backend service, I added the proxy-rewrite plugin to my routes conf. But the web client got empty response from the server and The upstream service is configured correctly because if I remove the proxy-rewrite plugin and use Am I doing anything wrong when dealing with the proxy-rewrite and grpc-web? And what's the best practice to proxy the grpc service which is hosted at the root domain?
Environments I installed apisix and apisix-dashboard using helm.
The apisix ingress conf:
|
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 5 replies
-
PLAT at: https://github.com/apache/apisix/blob/master/docs/en/latest/plugins/grpc-web.md#enabling-the-plugin
for example, apisix/t/plugin/grpc-web/a6/route.proto Lines 20 to 25 in 4c75c26 if you want to access curl http://127.0.0.1:9180/apisix/admin/routes/1 \
-H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
{
"uri":"/grpc/web/*",
"plugins":{
"grpc-web":{}
},
"upstream":{
"scheme":"grpc",
"type":"roundrobin",
"nodes":{
"127.0.0.1:1980":1
}
}
}' access this route by js, the request path maybe like the apisix/apisix/plugins/grpc-web.lua Lines 94 to 99 in 4c75c26 /a6.RouteService/GetRoute .
this would work. in your way, add a route config like |
Beta Was this translation helpful? Give feedback.
-
@tzssangglass Thanks for your explanation. After some tries, I find the grpc-web plugin actually works if apisix is installed by docker. But the helm version does not work. Route uri like I make the request from web client but the reponse returns 200 with a header said |
Beta Was this translation helpful? Give feedback.
-
The discussion is about the helm version of apisix. Removing the second slash from the route path works.
Moreover, even the grpc-web plugin is disabled, it makes no difference to the result. The grpc-web is not found in this list: https://github.com/apache/apisix-helm-chart/blob/master/charts/apisix/values.yaml#L217
|
Beta Was this translation helpful? Give feedback.
-
I think using the grpc-web plugin without proxy-rewrite to modify the If the same configuration produces inconsistent behavior in helm and docker, please give detailed steps to reproduce them so I can reproduce them locally. |
Beta Was this translation helpful? Give feedback.
PLAT at: https://github.com/apache/apisix/blob/master/docs/en/latest/plugins/grpc-web.md#enabling-the-plugin
for example,
apisix/t/plugin/grpc-web/a6/route.proto
Lines 20 to 25 in 4c75c26