Welcome! Log In Create A New Profile

Advanced

Re: nginx + grpc-web

Maxim Dounin
June 29, 2018 11:14AM
Hello!

On Thu, Jun 28, 2018 at 11:19:38AM -0400, donald.williams.0018 wrote:

> I try to use nginx + grpc + grpc-web client JS library
> (https://github.com/grpc/grpc-web).
>
> Nginx-1 is compiled using the following setup:
> nginx version: nginx/1.15.0
> built by gcc 7.2.0 (Ubuntu 7.2.0-8ubuntu3.1~16.04.york0)
> built with OpenSSL 1.0.2g 1 Mar 2016
> TLS SNI support enabled
> configure arguments: --with-threads --with-file-aio
> --with-http_ssl_module --with-http_v2_module

[...]

> If I use Nginx-2, the web JS client can connect to the service.
>
> For Nginx-1, the web JS client cannot connect to the service. Nginx returns
> the following error:
> [error] 26125#26125: *1 upstream rejected request with error 2 while
> reading response header from upstream, client: 192.168.50.101, server:
> localhost, request: "POST /helloworld.Greeter/SayHello HTTP/1.1", upstream:
> "grpc://127.0.0.1:50051", host: "localhost:8080", referrer:
> "http://localhost:8080/hello.html"

[...]

> It seems that Nginx-1 might have some issue with the encoding or the
> translation of http1 to http2. Do you have any suggestion of what is the
> issue?

gRPC and gRPC-Web are different protocols. gRPC-Web clients
cannot connect to gRPC services without special translation from
gRPC-Web to gRPC, and this is not something gRPC proxy module in
nginx does.

--
Maxim Dounin
http://mdounin.ru/
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

nginx + grpc-web

donald.williams.0018 June 28, 2018 11:19AM

Re: nginx + grpc-web

Maxim Dounin June 29, 2018 11:14AM

Re: nginx + grpc-web

donald.williams.0018 June 29, 2018 07:48PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 147
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready