<div dir="ltr">Hi all,<div><br></div><div>I'm starting develop my own upstream module. And I have question: How can i disable server directive in upstream block.</div><div><br></div><div>http {</div><div> upstream my_upstream {</div>
<div> my_endpoint addr port;</div><div> }</div><div><br></div><div><div> server {</div><div> location / {</div><div> proxy_pass <a href="http://my_upstream">http://my_upstream</a>;</div>
<div> }</div><div> }</div></div><div>}</div><div><br></div><div>As can you see I didn't use server but i used my_endpoint.</div><div><br></div><div><br></div><div>After some googling i found ZerroMQ module:</div>
<div><font color="#000000">static char *</font></div>
<pre style="margin-top:0px;margin-bottom:0px"><font color="#000000">ngx_http_upstream_zeromq_endpoint(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)</font></pre>
<pre style="margin-top:0px;margin-bottom:0px"><font color="#000000">{</font></pre>
<pre style="margin-top:0px;margin-bottom:0px"><font color="#000000"> ngx_http_upstream_srv_conf_t *uscf;</font></pre>
<pre style="margin-top:0px;margin-bottom:0px"><font color="#000000"> uscf = ngx_http_conf_get_module_srv_conf(cf, ngx_http_upstream_module);</font></pre>
<pre style="margin-top:0px;margin-bottom:0px"><br></pre><pre style="margin-top:0px;margin-bottom:0px">....</pre><pre style="margin-top:0px;margin-bottom:0px"><br></pre><pre style="margin-top:0px;margin-bottom:0px"> THEY USE THIS</pre>
<pre style="margin-top:0px;margin-bottom:0px"><font color="#000000"> uscf->servers = (ngx_array_t *) -1;</font></pre>
<pre style="margin-top:0px;margin-bottom:0px"><font color="#000000"> </font></pre><pre style="margin-top:0px;margin-bottom:0px"><font color="#000000">...</font></pre><pre style="margin-top:0px;margin-bottom:0px"><font color="#000000"><br>
</font></pre>
<pre style="margin-top:0px;margin-bottom:0px"><font color="#000000"> return NGX_CONF_OK;</font></pre>
<pre style="margin-top:0px;margin-bottom:0px"><font color="#000000">}</font></pre><pre style="margin-top:0px;margin-bottom:0px"><font color="#000000"><br></font></pre><pre style="margin-top:0px;margin-bottom:0px"><font color="#000000">But it doesn't work now (nginx closed without any errors/warnings). Thanks for any help.</font></pre>
<pre style="margin-top:0px;margin-bottom:0px"><font color="#000000"><br></font></pre><pre style="margin-top:0px;margin-bottom:0px"><font color="#000000">Regards,</font></pre><pre style="margin-top:0px;margin-bottom:0px"><font color="#000000">R. Savchenko.</font></pre>
<div><br></div><div><br></div></div>