<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
Hi Maxim,</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
It's not in upstream block. It's in server block. Please refer code snip below. </div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
upstream backend_grpc {
<div> server unix:/tmp/nginx_local/grpc_be_management.sock;</div>
} </div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
server {
<div> listen 443 http2 default_server;</div>
<div><br>
</div>
<div> ssl on;</div>
<div> ssl_certificate default.crt;</div>
<div> ssl_certificate_key default.key;</div>
<div><br>
</div>
<div> ssl_session_timeout 5m;</div>
<div><br>
</div>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
<span>....</span></div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
<span><br>
</span></div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
<span> location /gnmi {
<div> grpc_pass grpc://backend_grpc;</div>
<div> set $grpc_client_cert_auth 1;</div>
<div> if ($ssl_client_verify != SUCCESS){</div>
<div> set $grpc_client_cert_auth 0;</div>
<div> }</div>
<div> client_body_timeout 2000000;</div>
<div> #grpc_read_timeout 2000000;</div>
<div><br>
</div>
<div> #grpc_set_header cl_cert_s_dn $ssl_client_s_dn;</div>
<div> #grpc_set_header cl_cert_status $grpc_client_cert_auth;</div>
<span> }</span><br>
</span></div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
<span><span> }</span></span></div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
<span><span><br>
</span></span></div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
<span><span>Regards,</span></span></div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
<span><span>Babu</span></span></div>
<div>
<div id="appendonsend"></div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size: 11pt;"><b>From:</b> Maxim Konovalov <maxim@nginx.com><br>
<b>Sent:</b> Friday, June 4, 2021 2:15 AM<br>
<b>To:</b> nginx@nginx.org <nginx@nginx.org>; babu vel <babuvel_d@hotmail.com><br>
<b>Subject:</b> Re: Using gRPC nginx gateway</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt">
<div class="PlainText">Hi Babu,<br>
<br>
On 04.06.2021 10:54, babu vel wrote:<br>
> Hi,<br>
> <br>
> Am using nginx 1.17.3 version and trying to enable http2 and gRPC<br>
> gateway. I compiled it enabling http_v2 and gRPC module. However, am<br>
> still getting below error reporting unknown directive "grpc_pass", can<br>
> you please let me know what is the issue here?<br>
> <br>
> # nginx -c /nginx/conf/grpc.conf -t<br>
> nginx: [emerg] unknown directive "grpc_pass" in /nginx/conf/grpc.conf:165<br>
> nginx: configuration file /nginx/conf/grpc.conf test failed<br>
> #<br>
> <br>
> # cat -n /nginx/conf/grpc.conf | grep -i http2<br>
> 88 listen 443 http2 default_server;<br>
> # cat -n /nginx/conf/grpc.conf | grep -i grpc<br>
> 83 upstream backend_grpc {<br>
> 84 server unix:/tmp/nginx_local/grpc_be_management.sock;<br>
> 165 grpc_pass grpc://backend_grpc;<br>
> 166 set $grpc_client_cert_auth 1;<br>
> 168 set $grpc_client_cert_auth 0;<br>
> 171 #grpc_read_timeout 2000000;<br>
> 173 #grpc_set_header cl_cert_s_dn $ssl_client_s_dn;<br>
> 174 #grpc_set_header cl_cert_status $grpc_client_cert_auth;<br>
> #<br>
> <br>
[...]<br>
<br>
You cannot really use this directive in the upstream block, see<br>
<br>
<a href="http://nginx.org/r/grpc_pass">http://nginx.org/r/grpc_pass</a><br>
<br>
-- <br>
Maxim Konovalov<br>
</div>
</span></font></div>
</div>
</body>
</html>