houshunwei edited a comment on issue #1833:
URL:
https://github.com/apache/incubator-apisix/issues/1833#issuecomment-657432792
I have resolved this problem:
First Try: extend proxy-rewrite(add grpc and grpcs scheme) and change apisix
bin file:
```
location @grpc_pass {
set $upstream_scheme 'grpc';
access_by_lua_block {
apisix.grpc_access_phase()
}
grpc_set_header Content-Type application/grpc;
grpc_socket_keepalive on;
grpc_pass $upstream_scheme://apisix_backend;
...
```
Problem: `grpc_pass` is different form `proxy_pass`, it cannot accept
variable( which you defined by `set`).
Result: `Failed`.
Second Try:add other block in apisix bin file. and change jugement in
init.lua
```
location @grpc_pass_ssl {
access_by_lua_block {
apisix.grpc_access_phase()
}
grpc_set_header Content-Type application/grpc;
grpc_socket_keepalive on;
grpc_pass grpcs://apisix_backend;
...
```
Result: It works!
I will close this issue now.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]