<div dir="ltr"><div><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Apr 10, 2017 at 1:04 PM, B.R. via nginx <span dir="ltr"><<a target="_blank" href="mailto:nginx@nginx.org">nginx@nginx.org</a>></span> wrote:<br><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote"><div dir="ltr"><div style="font-size:small;color:rgb(51,51,153)">You could have got your answer yourself by Reading The... Fine? Manual:<br><a target="_blank" href="https://nginx.org/en/docs/control.html">https://nginx.org/en/docs/<wbr>control.html</a><br><br></div><div 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>I suggest you take a look at everything: <a target="_blank" href="https://nginx.org/en/docs/">https://nginx.org/en/docs/</a></div></div></div></blockquote><div><br>Thanks B.R., I surely will !!<br> <br></div><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote"><div dir="ltr"><div class="gmail_extra"><div><div class="gmail-m_4663480122684170070gmail_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><div><div class="gmail-h5">
<br><div class="gmail_quote">On Sun, Apr 9, 2017 at 4:25 PM, Ajay Garg <span dir="ltr"><<a target="_blank" href="mailto:ajaygargnsit@gmail.com">ajaygargnsit@gmail.com</a>></span> wrote:<br><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote"><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="gmail-m_4663480122684170070h5">On Sun, Apr 9, 2017 at 7:29 PM, Lucas Rolff <span dir="ltr"><<a target="_blank" href="mailto:lucas@lucasrolff.com">lucas@lucasrolff.com</a>></span> wrote:<br></div></div><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote"><div><div class="gmail-m_4663480122684170070h5">
<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="gmail-m_4663480122684170070m_2283995562650823769m_-3545107808673131547MAC_OUTLOOK_SIGNATURE"></div>
</div>
</div>
<div><br>
</div>
<span id="gmail-m_4663480122684170070m_2283995562650823769m_-3545107808673131547OLK_SRC_BODY_SECTION">
<div style="font-family:calibri;font-size:12pt;text-align:left;color:black;border-width:1pt medium medium;border-style:solid none none;border-color:rgb(181,196,223) -moz-use-text-color -moz-use-text-color;padding:3pt 0in 0in">
<span style="font-weight:bold">From: </span>nginx <<a target="_blank" href="mailto:nginx-bounces@nginx.org">nginx-bounces@nginx.org</a>> on behalf of Ajay Garg <<a target="_blank" href="mailto:ajaygargnsit@gmail.com">ajaygargnsit@gmail.com</a>><br>
<span style="font-weight:bold">Reply-To: </span>"<a target="_blank" href="mailto:nginx@nginx.org">nginx@nginx.org</a>" <<a target="_blank" href="mailto:nginx@nginx.org">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 target="_blank" href="mailto:nginx@nginx.org">nginx@nginx.org</a>" <<a target="_blank" href="mailto:nginx@nginx.org">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="gmail-m_4663480122684170070m_2283995562650823769m_-3545107808673131547MAC_OUTLOOK_ATTRIBUTION_BLOCKQUOTE">
<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="gmail-m_4663480122684170070m_2283995562650823769m_-3545107808673131547gmail-go"><a target="_blank" href="mailto:francis@daoine.org">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 target="_blank" href="https://127.0.0.1:2000">
https://127.0.0.1:2001</a>;<br>
<wbr> }<br>
<br>
if ($remote_user = "user2") {<br>
<wbr> proxy_pass <a target="_blank" href="https://127.0.0.1:2000">
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 target="_blank" href="mailto:nginx@nginx.org">nginx@nginx.org</a><br>
<a target="_blank" rel="noreferrer" href="http://mailman.nginx.org/mailman/listinfo/nginx">http://mailman.nginx.org/mailm<wbr>an/listinfo/nginx</a><span class="gmail-m_4663480122684170070HOEnZb"><font color="#888888"><br></font></span></blockquote></div><span class="gmail-m_4663480122684170070HOEnZb"><font color="#888888"><br><br clear="all"><br>-- <br><div class="gmail-m_4663480122684170070m_2283995562650823769gmail_signature">Regards,<br>Ajay<br></div>
</font></span></div>
<br>______________________________<wbr>_________________<br>
nginx mailing list<br>
<a target="_blank" href="mailto:nginx@nginx.org">nginx@nginx.org</a><br>
<a target="_blank" rel="noreferrer" href="http://mailman.nginx.org/mailman/listinfo/nginx">http://mailman.nginx.org/mailm<wbr>an/listinfo/nginx</a><br></blockquote></div><br></div></div></div></div>
<br>______________________________<wbr>_________________<br>
nginx mailing list<br>
<a href="mailto:nginx@nginx.org">nginx@nginx.org</a><br>
<a target="_blank" rel="noreferrer" href="http://mailman.nginx.org/mailman/listinfo/nginx">http://mailman.nginx.org/<wbr>mailman/listinfo/nginx</a><br></blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature">Regards,<br>Ajay<br></div>
</div></div>