<div dir="ltr"><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><div>Following architecture works like a charm (thanks a ton to<span class="gmail-go"> <a href="mailto:francis@daoine.org">francis@daoine.org</a></span>, without whom I would not have been able to reach here) ::<br><br></div><div>####################################################<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 =  "<wbr>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>                              <wbr>          if ($remote_user =  "<wbr>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>                                       # and so on ....<br><div><br>                }<br>         }<br>####################################################<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></div>