Nginx grpc反向代理

时间:2021-05-11 07:45:15

L111

https://grpc.io/  grpc官网

Nginx grpc反向代理

Nginx grpc反向代理

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

分布式反向代理

server {
server_name shop**.com.cn; root html;
location / {
grpc_pass localhost:; //这里指向GRPC服务端
} listen 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 }