这是可行的:
server {
listen 5005 http2;
location / {
grpc_pass grpc://my_app:5001;
}
default_type application/grpc;
}这不起作用:
server {
listen 5005 http2;
location /test {
grpc_pass grpc://my_app:5001;
}
default_type application/grpc;
}当我转到localhost:5005时收到日志,它看起来是这样的:
192.168.0.1 - - [20/Sep/2021:10:18:02 +0000] "POST /tasks.TasksServiceGRPC/AskForJob HTTP/2.0" 200 153 "-" "grpc-node/1.24.7 grpc-c/8.0.0 (windows; chttp2; ganges)" "-"当我转到localhost:5005/test时,我甚至没有得到nginx中的日志
在http 1.1上,一切运行正常。
发布于 2021-11-23 18:15:05
由于请求结构的原因,这在grpc中是不可能的
https://stackoverflow.com/questions/69252894
复制相似问题