(no subject)

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

(no subject)

wirelessduck
Hi,

I would like to know whether nginx supports mirroring of a gRPC proxy?
 I've got a backend server with two endpoints running and setup nginx
with the following config:

server {
    listen 50051 http2 ssl;

    ssl_certificate      /etc/ssl/certs/ssl-cert-snakeoil.pem;
    ssl_certificate_key  /etc/ssl/private/ssl-cert-snakeoil.key;
    ssl_session_cache    shared:SSL:10m;
    ssl_session_timeout  5m;
    ssl_ciphers          HIGH:!aNULL:!MD5;
    ssl_protocols        TLSv1.2 TLSv1.3;

    location / {
        mirror /mirror;
        mirror_request_body off;
        grpc_pass grpcs://grpc-server.example.com:50051;
    }

    location /mirror {
        internal;
        grpc_pass grpcs://grpc-server.example.com:50052;
    }
}

Sending a request to the nginx proxy only results in the request going
through to the endpoint on 50051, and nothing appears on the 50052
endpoint.  If I remove "mirror_request_body" config, then the request
results in a timeout and nothing appears on either endpoint.

Is this supported, or does nginx not yet support mirroring of gRPC?

Thanks
--Tom
_______________________________________________
nginx mailing list
[hidden email]
http://mailman.nginx.org/mailman/listinfo/nginx
Reply | Threaded
Open this post in threaded view
|

Re: your mail

Maxim Dounin
Hello!

On Tue, Sep 24, 2019 at 02:18:20PM +1000, [hidden email] wrote:

> Hi,
>
> I would like to know whether nginx supports mirroring of a gRPC proxy?
>  I've got a backend server with two endpoints running and setup nginx
> with the following config:
>
> server {
>     listen 50051 http2 ssl;
>
>     ssl_certificate      /etc/ssl/certs/ssl-cert-snakeoil.pem;
>     ssl_certificate_key  /etc/ssl/private/ssl-cert-snakeoil.key;
>     ssl_session_cache    shared:SSL:10m;
>     ssl_session_timeout  5m;
>     ssl_ciphers          HIGH:!aNULL:!MD5;
>     ssl_protocols        TLSv1.2 TLSv1.3;
>
>     location / {
>         mirror /mirror;
>         mirror_request_body off;
>         grpc_pass grpcs://grpc-server.example.com:50051;
>     }
>
>     location /mirror {
>         internal;
>         grpc_pass grpcs://grpc-server.example.com:50052;
>     }
> }
>
> Sending a request to the nginx proxy only results in the request going
> through to the endpoint on 50051, and nothing appears on the 50052
> endpoint.  If I remove "mirror_request_body" config, then the request
> results in a timeout and nothing appears on either endpoint.
>
> Is this supported, or does nginx not yet support mirroring of gRPC?

With "mirror_request_body off;" you are unlikely to get a
meaningful result with gRPC, as gRPC requests are in the request
body.

With "mirror_request_body on;" things are expected to work, but
might not - if the gRPC service expects streaming from the client.

--
Maxim Dounin
http://mdounin.ru/
_______________________________________________
nginx mailing list
[hidden email]
http://mailman.nginx.org/mailman/listinfo/nginx
Reply | Threaded
Open this post in threaded view
|

Re: your mail

wirelessduck

> On 24 Sep 2019, at 21:32, Maxim Dounin <[hidden email]> wrote:
>
> With "mirror_request_body off;" you are unlikely to get a
> meaningful result with gRPC, as gRPC requests are in the request
> body.
>
> With "mirror_request_body on;" things are expected to work, but
> might not - if the gRPC service expects streaming from the client.

Thanks Maxim. I guess it won’t work here in my configuration then.

I had another attempt using Envoy and that seems to be working for me.

—Tom
_______________________________________________
nginx mailing list
[hidden email]
http://mailman.nginx.org/mailman/listinfo/nginx