<div dir="ltr">Rewrites will execute before authentication module handlers run; this is a function of how Nginx is designed, and this order isn't configurable. See <a href="http://forum.nginx.org/read.php?2,41891,43112#msg-43112">http://forum.nginx.org/read.php?2,41891,43112#msg-43112</a> and <a href="http://www.nginxguts.com/2011/01/phases/">http://www.nginxguts.com/2011/01/phases/</a>.</div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Oct 5, 2015 at 12:42 PM, Richard Stanway <span dir="ltr"><<a href="mailto:r1ch+nginx@teamliquid.net" target="_blank">r1ch+nginx@teamliquid.net</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">How are you testing? 301 is permanent so it may be cached if you added the auth after the redirect. Try testing with curl from the command line to verify your results.<div class="gmail_extra"><br><div class="gmail_quote">On Mon, Oct 5, 2015 at 7:05 PM, Grant <span dir="ltr"><<a href="mailto:emailgrant@gmail.com" target="_blank">emailgrant@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I have a server block that contains the following:<br>
<br>
auth_basic "Please log in.";<br>
location = / {<br>
    return 301 https://$host:$server_port/folder/;<br>
}<br>
<br>
I noticed that /folder/ is appended to the URL before the user is<br>
prompted for authentication.  Can that behavior be changed?<br>
<br>
- Grant<br>
<br>
_______________________________________________<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/mailman/listinfo/nginx</a><br>
</blockquote></div><br></div></div>
<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>