<div dir="ltr"><div class="gmail_default" style="font-size:small;color:rgb(51,51,153)">You could have got your answer yourself by Reading The... Fine? Manual:<br><a href="https://nginx.org/en/docs/control.html">https://nginx.org/en/docs/control.html</a><br><br></div><div class="gmail_default" style="font-size:small;color:rgb(51,51,153)">There are tons of interesting pieces of informations there, by the nature of said docs...<br></div><div class="gmail_extra"><div style="font-size:small;color:rgb(51,51,153)" class="gmail_default">I suggest you take a look at everything: <a href="https://nginx.org/en/docs/">https://nginx.org/en/docs/</a></div><div><div class="gmail_signature" data-smartmail="gmail_signature"><font size="1"><span style="color:rgb(102,102,102)">---<br></span><b><span style="color:rgb(102,102,102)">B. R.</span></b><span style="color:rgb(102,102,102)"></span></font></div></div>
<br><div class="gmail_quote">On Sun, Apr 9, 2017 at 4:25 PM, Ajay Garg <span dir="ltr"><<a href="mailto:ajaygargnsit@gmail.com" target="_blank">ajaygargnsit@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div><div><div><div>Thanks a ton Lucas.<br><br></div>Just checked reloading, and the previous proxy-session was intact !!<br></div>Thanks a ton again.<br><br></div>And sorry I missed your name in the credits, you too had helped a greate deal yesterday, and today too !!<br></div>Thanks a ton again !!!<br><br><br></div>Thanks and Regards,<br></div>Ajay<br></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">On Sun, Apr 9, 2017 at 7:29 PM, Lucas Rolff <span dir="ltr"><<a href="mailto:lucas@lucasrolff.com" target="_blank">lucas@lucasrolff.com</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5">
<div style="word-wrap:break-word;color:rgb(0,0,0);font-size:14px;font-family:Calibri,sans-serif">
<div>
<div>Hi Ajay,</div>
<div><br>
</div>
<div>If you generate the configuration, and issue a nginx reload – it won't cause any downtime. The master process will reread the configuration, start new workers, and gracefully shut down the old ones.</div>
<div>There's absolutely no downtime involved in this process.</div>
<div><br>
</div>
<div>
<div id="m_2283995562650823769m_-3545107808673131547MAC_OUTLOOK_SIGNATURE"></div>
</div>
</div>
<div><br>
</div>
<span id="m_2283995562650823769m_-3545107808673131547OLK_SRC_BODY_SECTION">
<div style="font-family:Calibri;font-size:12pt;text-align:left;color:black;BORDER-BOTTOM:medium none;BORDER-LEFT:medium none;PADDING-BOTTOM:0in;PADDING-LEFT:0in;PADDING-RIGHT:0in;BORDER-TOP:#b5c4df 1pt solid;BORDER-RIGHT:medium none;PADDING-TOP:3pt">
<span style="font-weight:bold">From: </span>nginx <<a href="mailto:nginx-bounces@nginx.org" target="_blank">nginx-bounces@nginx.org</a>> on behalf of Ajay Garg <<a href="mailto:ajaygargnsit@gmail.com" target="_blank">ajaygargnsit@gmail.com</a>><br>
<span style="font-weight:bold">Reply-To: </span>"<a href="mailto:nginx@nginx.org" target="_blank">nginx@nginx.org</a>" <<a href="mailto:nginx@nginx.org" target="_blank">nginx@nginx.org</a>><br>
<span style="font-weight:bold">Date: </span>Sunday, 9 April 2017 at 15.55<br>
<span style="font-weight:bold">To: </span>"<a href="mailto:nginx@nginx.org" target="_blank">nginx@nginx.org</a>" <<a href="mailto:nginx@nginx.org" target="_blank">nginx@nginx.org</a>><br>
<span style="font-weight:bold">Subject: </span>Mechanism to avoid restarting nginx upon every change<br>
</div>
<div><br>
</div>
<span>
<blockquote id="m_2283995562650823769m_-3545107808673131547MAC_OUTLOOK_ATTRIBUTION_BLOCKQUOTE" style="BORDER-LEFT:#b5c4df 5 solid;PADDING:0 0 0 5;MARGIN:0 0 0 5">
<div>
<div>
<div dir="ltr"><span>
<div>Hi All.<br>
<br>
</div>
<div>We are wanting to implement a solution, wherein the user gets proxied to the appropriate local-url, depending upon the credentials.<br>
</div>
</span><div>Following architecture works like a charm (thanks a ton to<span class="m_2283995562650823769m_-3545107808673131547gmail-go"><a href="mailto:francis@daoine.org" target="_blank">francis@daoine.org</a></span>, without whom I would not have been able to reach here) ::<br>
<br>
</div><span>
<div>##############################<wbr>######################<br>
server {<br>
listen 2000 ssl;<br>
<br>
ssl_certificate /etc/nginx/ssl/nginx.crt;<br>
ssl_certificate_key /etc/nginx/ssl/nginx.key;<br>
<br>
location / {<br>
<wbr> auth_basic 'Restricted';<br>
<wbr> auth_basic_user_file /etc/nginx/ssl/.htpasswd;<br>
<br>
<wbr> if ($remote_user = "user1") {<br>
<wbr> proxy_pass <a href="https://127.0.0.1:2000" target="_blank">
https://127.0.0.1:2001</a>;<br>
<wbr> }<br>
<br>
if ($remote_user = "user2") {<br>
<wbr> proxy_pass <a href="https://127.0.0.1:2000" target="_blank">
https://127.0.0.1:2002</a>;<br>
<wbr> }<br>
<br>
</div>
<wbr> # and so on ....<br>
<div><br>
}<br>
}<br>
##############################<wbr>######################<br>
<br>
<br>
</div>
<div>Things are good, except that adding any new user information requires reloading/restarting the nginx server, causing (however small) downtime.<br>
<br>
</div>
<div>Can this be avoided?<br>
</div>
<div>Can the above be implemented using some sort of database, so that the nginx itself does not have to be down, and the "remote_user <=> proxy_pass" mapping can be retrieved from a database instead?<br>
<br>
</div>
<div>Will be grateful for pointers.<br>
<br>
<br>
</div>
<div>Thanks and Regards,<br>
</div>
<div>Ajay<br>
</div>
</span></div>
</div>
</div>
</blockquote>
</span></span>
</div>
<br></div></div>______________________________<wbr>_________________<br>
nginx mailing list<br>
<a href="mailto:nginx@nginx.org" target="_blank">nginx@nginx.org</a><br>
<a href="http://mailman.nginx.org/mailman/listinfo/nginx" rel="noreferrer" target="_blank">http://mailman.nginx.org/mailm<wbr>an/listinfo/nginx</a><span class="HOEnZb"><font color="#888888"><br></font></span></blockquote></div><span class="HOEnZb"><font color="#888888"><br><br clear="all"><br>-- <br><div class="m_2283995562650823769gmail_signature" data-smartmail="gmail_signature">Regards,<br>Ajay<br></div>
</font></span></div>
<br>______________________________<wbr>_________________<br>
nginx mailing list<br>
<a href="mailto:nginx@nginx.org">nginx@nginx.org</a><br>
<a href="http://mailman.nginx.org/mailman/listinfo/nginx" rel="noreferrer" target="_blank">http://mailman.nginx.org/<wbr>mailman/listinfo/nginx</a><br></blockquote></div><br></div></div>