<div dir="ltr"><div class="gmail_default" style="font-size:small;color:rgb(51,51,153)">Why would you want to do that? Spaghetti configuration?<br></div><div class="gmail_default" style="font-size:small;color:rgb(51,51,153)"><span id="goog_451016612"></span><span id="goog_451016613"></span>Some advice from Igor Sysoev: <a href="https://youtu.be/YWRYbLKsS0I">https://youtu.be/YWRYbLKsS0I</a><br></div><div class="gmail_extra"><div><div class="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 Wed, Mar 23, 2016 at 1:00 AM, Jonathan Vanasco <span dir="ltr"><<a href="mailto:nginx@2xlp.com" target="_blank">nginx@2xlp.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">apologies for the simple question, but i could only find the opposite situation in the list archives and I haven't had to reconfigure some of these routes in years!<br>
<br>
i have<br>
<br>
        # works<br>
        location /foo {<br>
                proxy_pass  <a href="http://127.0.0.1:6543" rel="noreferrer" target="_blank">http://127.0.0.1:6543</a>;<br>
        }<br>
<br>
I want to lock down /foo/admin with basic auth<br>
<br>
        # works<br>
        location /foo/admin {<br>
                proxy_pass  <a href="http://127.0.0.1:6543" rel="noreferrer" target="_blank">http://127.0.0.1:6543</a>;<br>
                auth_basic "Administrator Login";<br>
                auth_basic_user_file /etc/nginx/_htpasswd/well-known;<br>
        }<br>
<br>
Is there a syntax for nesting the two together, so the /foo/admin would inherit the /foo configuration without the need to redeclare everything?<br>
<br>
        # something like<br>
        location /foo {<br>
                proxy_pass  <a href="http://127.0.0.1:6543" rel="noreferrer" target="_blank">http://127.0.0.1:6543</a>;<br>
                location /foo/admin {<br>
                        auth_basic "Administrator Login";<br>
                        auth_basic_user_file /etc/nginx/_htpasswd/well-known;<br>
                }<br>
        }<br>
<br>
_______________________________________________<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/mailman/listinfo/nginx</a><br>
</blockquote></div><br></div></div>