title: Nginx - custom login page
body: <p>I'm trying to secure my webapp by using nginx base authentication.</p>
  
  <p>What I'm looking for is a way to  force the browser to show my custom html login page instead of the default login popup but still handle the authorization process.</p>
  
  <p>I try to omit the 'WWW-Authenticate' header and the popup wasn't display but I've no idea how to force the browser to add the 'Authorization' header for each request.</p>
  
  <p>hereby nginx.conf:</p>
  
  <pre><code>location /{
              auth_basic "Restricted";
              auth_basic_user_file htpasswd;
              proxy_pass http://tomcat:8080/;
              error_page 401  /login.html;
      }
  
      location = /login.html {
              root html;
      more_clear_headers 'WWW-Authenticate';              
      }
  </code></pre>