Nginx grpc反向代理

L111

https://grpc.io/  grpc官网

Nginx grpc反向代理_第1张图片

Nginx grpc反向代理_第2张图片

 

首先Grpc 默认编译进Nginx 但是依赖http_v2模块 需要编译进nginx 具体指令可以参考Nginx http 反向代理 指令都类似

分布式反向代理

 

server {
    server_name shop**.com.cn;

    root html;
    location / {
        grpc_pass localhost:50051; //这里指向GRPC服务端
    }

    listen 4431 http2; # managed by Certbot 这里要注意 要去掉 ssl
    ssl_certificate /etc/letsencrypt/live/http2.taohui.tech/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/http2.taohui.tech/privkey.pem; # managed by Certbot
    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot

}

 

转载于:https://www.cnblogs.com/jackey2015/p/10565907.html

你可能感兴趣的:(运维)