title: How to check if the request header contains authorization in nginx
body: <p>I've read on this <a href="https://stackoverflow.com/questions/36057631/nginx-password-authentication-keeps-prompting-for-password">post</a> that Nginx does not support multiple Authorization headers.</p>
  
  <p>I was wondering if how I would check in the http request if an
  authorization header is present.</p>
  
  <p>basically I am adding a basic auth to my webpage since its not ready for production yet. My site is a single page application and I have successfully added authentication in the index page, but my site has also log in feature. When I log in it keeps asking for the authentication again. Im new to nginx and I am not quite sure how to get around with this </p>
  
  <pre><code> location / {
  
          root /path/to/my/app/root/folder;
          index index.html index.php;
  
          #I want to only executed these lines only on the index page and login page 
          auth_basic "Restricted";
          auth_basic_user_file /etc/nginx/.htpasswd;
      }
  </code></pre>