<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p>You can specify different auth_basic configurations per server or
per location match.</p>
<p>Refer to the documentation - <a
href="http://nginx.org/en/docs/http/ngx_http_auth_basic_module.html">http://nginx.org/en/docs/http/ngx_http_auth_basic_module.html</a>
- which shows that the auth_basic config options can be at the
http, server, location, or limit_except levels of the
configuration. You can configure different server hostnames or
locations within the same server block.</p>
<p>Example configuration - different auth sets per location path
within the foo.example.com auth AND a site config that will have a
completely separate third auth that covers an entire site
(private.example.com) (note that both of these server definitions
are implied to be in an http server block, I just am not typing it
out here for brevity)<br>
</p>
<p>server {</p>
<p> listen 80;</p>
<p> server_name foo.example.com;<br>
</p>
<p> location /foo/ {</p>
<p> try_files $uri $uri/ =403;<br>
</p>
<p> auth_basic on;</p>
<p> auth_basic_user_file /etc/nginx/fooauths;</p>
<p> }<br>
</p>
<p> location / {</p>
<p> try_files $uri $uri/ =403;</p>
<p> auth_basic on;</p>
<p> auth_basic_user_file /etc/nginx/rootauths;</p>
<p> }</p>
<p>}</p>
<p>server {</p>
<p> listen 80;</p>
<p> server_name private.example.com;</p>
<p> auth_basic on;</p>
<p> auth_basic_user_file /etc/nginx/privateauths;</p>
<p> location / {</p>
<p> try_files $uri $uri/ =403;</p>
<p> }</p>
<p>}</p>
<p><br>
</p>
<p>Thomas</p>
<p><br>
</p>
<div class="moz-cite-prefix">On 3/19/20 11:23 AM, Roberto Carna
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CAG2Qp6sW7jBd-sJx2kNFqv=RKKrBk+hByfbzhEJR7k3EPLMqXg@mail.gmail.com">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<div dir="ltr">Hi people,
<div><br>
</div>
<div>I wanna use NGINX as a SSL reverse proxy for several
backends Apache web servers which listens on port TCP/8080 and
TCP/9090.</div>
<div><br>
</div>
<div>The NGINX reverse proxy must have one
independent authentication for each backend web server:</div>
<div><br>
</div>
<div>NGINX -- Auth 1 --- Web server 1 ports 8080/9090</div>
<div> -- Auth 2 --- Web server 2 ports 8080/9090</div>
<div> -- Auth 3 --- Web server 3 ports 8080/9090</div>
<div> etc.</div>
<div><br>
</div>
<div>Is it possible to do this???</div>
<div><br>
</div>
<div>Can you give me some info o link in this way ???</div>
<div><br>
</div>
<div>Thanks a lot and regards !!!</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<pre class="moz-quote-pre" wrap="">_______________________________________________
nginx mailing list
<a class="moz-txt-link-abbreviated" href="mailto:nginx@nginx.org">nginx@nginx.org</a>
<a class="moz-txt-link-freetext" href="http://mailman.nginx.org/mailman/listinfo/nginx">http://mailman.nginx.org/mailman/listinfo/nginx</a></pre>
</blockquote>
</body>
</html>