Welcome! Log In Create A New Profile


grpc with browser client

Posted by drkbkr 
grpc with browser client
October 09, 2018 01:15PM
We're experimenting with grpc and ways to expose those services to clients. I've followed along with the blog post here:
https://www.nginx.com/blog/nginx-1-13-10-grpc/ and gotten the helloworld client to connect to the helloworld server through nginx but now I'm wondering if it's possible to route normal web client traffic to the grpc server and send back a response suitable for a browser. We have a lot of existing web client code (html / javascript, etc) that we'd prefer not to muck with.

Our server is configured like:

server {
listen 80 http2;
listen 443 ssl http2;

ssl_certificate cert.pem;
ssl_certificate_key cert.key;

ssl_session_cache shared:SSL:1m;
ssl_session_timeout 5m;

ssl_ciphers HIGH:!aNULL:!MD5;
ssl_prefer_server_ciphers on;

access_log logs/host.access.log main;

location / {
root /usr/share/nginx/html;
index index.html;

location /helloworld.Greeter/SayHello {
grpc_pass grpc://;

# redirect server error pages to the static page /50x.html
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;


The request gets issued using curl:
curl -k -X POST

And the error in the error log:
2018/10/09 11:46:32 [error] 25850#25850: *60 upstream rejected request with error 2 while reading response header from upstream, client:, server:, request: "POST /helloworld.Greeter/SayHello HTTP/2.0", upstream: "grpc://", host: ""

Other maybe useful information: using nginx 1.14.0 on arch linux. grpc server is the python version of the helloworld server

Any help would be greatly appreciated!

Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 71
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready