title: NGINX basic authentication - redirect to home page on 401 authentication error
body: <p>I would like to redirect to my home page again if the authentication failed, since the authentication fails with basic authentication from ngnix even if you press cancel and do not even try to authenticate. </p>
  
  <p>If I do it the way shown in the screenshot it simply loads the page; so redirection works but the authentication and hence the access of the other page does not show up anymore. Do you know anything else I could try? </p>
  
  <p><img src="https://i.stack.imgur.com/vuZr2.png" alt="enter image description here"></p>