You could use nginx as a TCP load balancer (layer 4), instead of HTTP
(layer 7). However, the actual load balancing performance will likely be
much worse, especially if clients are using long-lived persistent
connections without any sort of client-side load balancing logic (like
opening multiple connections and using some scheme, like round-robin, to
fan out requests to those connections).

I think there may even be a way to combine TCP load balancing with TLS
termination, though I think there was an issue relating to ALPN (used to
negotiate http/2 protocol during TLS handshake). Here's a related thread:
https://groups.google.com/d/topic/grpc-io/mPcCdVEo-fM/discussion


----
*Josh Humphries*
[email protected]

On Thu, Aug 31, 2017 at 12:06 AM, Osman Ali <[email protected]> wrote:

> Nginx currently doesn't send http2 to your upstream location. You would be
> sending http 1.1 after nginx terminates.
>
> You can use other options:
>
> https://github.com/lyft/envoy
>
> https://nghttp2.org/
>
> On Tuesday, August 29, 2017 at 10:54:08 AM UTC-7, [email protected]
> wrote:
>>
>>
>> I understand that the question is more appropriate for nginx group, but
>> still... Does anyone have a _working_ nginx.conf file that does the job?
>> I ended up with 404 from nginx sending gRPC requests (yes, valid
>> requests, verified) with the following nginx.conf:
>>
>> events {
>>   worker_connections  4096;  ## Default: 1024
>> }
>>
>> http {
>>   upstream ip-10-100-30-92 {
>>     server ip-10-100-30-147:50101;
>>     server ip-10-100-130-12:50101;
>>   }
>>
>>   server {
>>     listen 50101;
>>     server_name ip-10-100-30-92;
>>     location / {
>>       proxy_pass http://ip-10-100-30-92;
>>     }
>>   }
>> }
>>
>>
>> This file produces 404 response and a line in /var/log/nginx/access.log:
>>
>> 192.168.13.238 - - [29/Aug/2017:16:56:34 +0000] "PRI * HTTP/2.0" 400 173
>> "-" "-"
>>
>>
>> Actually, I try to use SSL, and a _working_ example of nginx.conf would
>> be _really_ appreciated.
>>
> --
> You received this message because you are subscribed to the Google Groups "
> grpc.io" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at https://groups.google.com/group/grpc-io.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/grpc-io/bb919b89-1923-45b9-9afc-02eba0ac0399%40googlegroups.com
> <https://groups.google.com/d/msgid/grpc-io/bb919b89-1923-45b9-9afc-02eba0ac0399%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/grpc-io.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/grpc-io/CAO78j%2BKoRAjLtRaGKM62FazJPGHyZjN-%2Bh-49qmdGEUzexZrdA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to