Welcome! Log In Create A New Profile

Advanced

Re: GRPC reverse proxy using same port for multiple grpc host/ports

Maxim Dounin
May 29, 2019 12:20PM
Hello!

On Tue, May 28, 2019 at 10:41:15PM -0400, isuru wrote:

> Hi All,
> I am trying to reverseproxy http2 base grpc using nginx.I attempted with
> nginx port 9092 to proxy to singl e grpc host port using a conf file inside
> conf.d.
>
> map $http_upgrade $connection_upgrade {
> default upgrade;
> '' close;
> }
>
> upstream sendssmgrpcservers {
> # The docker endpoint of your grpc servers, you can have multiple here
> server 10.2.4.25:6568;
> #server 10.2.4.200:6566;
> }
>
> #upstream sendSSMgrpcservers {
> #server 10.2.4.25:6568;
> #}
>
> server {
> listen 9092 http2;
> location / {
>
> # The 'grpc://' prefix is optional; unencrypted gRPC is the default
> grpc_pass grpc://sendssmgrpcservers;
> #grpc_pass grpc://10.2.4.226:6566;
>
> }}
>
> When I add another conf file for the same port with a different domain name
> in conf and to a different grpc host/port as upstream It does not forward
> to right grpc host port.
>
> Does http2 grpc reverseproxy not support multiple grpc host/port forward on
> same port?If yes how to configure that

nginx itself can handle name-based virtual servers for gRPC much
like for any other HTTP requests, just configuring appropriate
names via the server_name directive should be enough. But this
may not work if your gRPC client does not provide appropriate Host
and/or :authority headers in requests.

To find out what exactly happens with requests and if appropriate
headers are present, consider using debugging log. See here for
details:

http://nginx.org/en/docs/debugging_log.html

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

GRPC reverse proxy using same port for multiple grpc host/ports

isuru May 28, 2019 10:41PM

Re: GRPC reverse proxy using same port for multiple grpc host/ports

Maxim Dounin May 29, 2019 12:20PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 321
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