I have a simple grpc service helloworld. its server is running in ec2 instance behind nginx. I am trying to connect to grpc server from my local machine using curl. I am following the same code that is in official repo so I don't think any problem from code side because I can able to connect to my grpc server from my local grpc client (greeter_client.py).
But when I try in curl I am getting response like this
abci@learnerc MINGW64 ~/Desktop
$ curl -v -H "Content-Type: application/grpc" 3.x6.xx9.xx1:50052/helloworld --http2-prior-knowledge
* Uses proxy env variable no_proxy == 'xxx.xxx.xx.100'
* Trying x.xx.xxx.xx:50052...
* TCP_NODELAY set
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0* Connected to 3.xx.xxx.xxx (3.xx.xxx.xxx) port 50052 (#0)
* Using HTTP2, server supports multi-use
* Connection state changed (HTTP/2 confirmed)
* Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=0
* Using Stream ID: 1 (easy handle 0x6712b0)
> GET /helloworld HTTP/2
> Host: 3.xx.xxx.xxx:50052
> user-agent: curl/7.68.0
> accept: */*
> content-type: application/grpc
>
* Connection state changed (MAX_CONCURRENT_STREAMS == 128)!
< HTTP/2 204
< server: nginx/1.18.0 (Ubuntu)
< date: Fri, 12 Mar 2021 01:57:01 GMT
< grpc-status: 14
< grpc-message: unavailable
<
{ [0 bytes data]
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
* Connection #0 to host 3.xx.xxx.xxx left intact
My nginx config:
server {
listen 50052 http2;
location /helloworld {
default_type application/grpc;
grpc_pass grpc://localhost:50051;
}
# Error responses
include conf.d/errors.grpc_conf; # gRPC-compliant error responses
default_type application/grpc;
}
The grpc server is running in docker container with exposed port on 50051
.
root@ip-xx2-x1-xx-xx:/etc/nginx/sites-enabled# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
xxx xxx "/bin/sh -c 'python …" 6 hours ago Up 6 hours 0.0.0.0:50051->50051/tcp obje_galois
Thanks. Any help is appreciated.