title: NGINX | NetworkError: 401 Unauthorized ~ but it works?
body: <p>I've a really strange issue mostly with images and sometimes with URLs, too. (on my NGINX setup)</p>
  
  <p>Sometimes I find following message in the console of Firebug the message:</p>
  
  <pre><code>"NetworkError: 401 Unauthorized - http://myproject.mydomain.com/images/20150812/sample1.png"
  </code></pre>
  
  <p>or</p>
  
  <pre><code>"NetworkError: 401 Unauthorized - http://myproject.mydomain.com/appliaction/item/18/#"
  </code></pre>
  
  <p><strong>But the strange thing</strong> is, these things are loaded! There aren't anything missing. So I'm a little bit confused about this error message.</p>
  
  <p>Configuration:</p>
  
  <p><strong>myproject-file in "sites-available" and "sites-enabled"</strong> </p>
  
  <pre><code>server {
      listen 80;
      #listen 443 ssl;
  
      server_name myproject.mydomain.com;
      root /srv/www/myproject;
  
      access_log /var/log/nginx/myproject-access.log;
      error_log /var/log/nginx/myproject-error.log;
  
          include global/dev.conf;
  
  
  }
  </code></pre>
  
  <p><strong>dev.conf</strong></p>
  
  <pre><code>## Disable Access
      auth_basic "Restricted";
      auth_basic_user_file /etc/nginx/.htpasswd;
  
  ## Open instead listing (start)
      index index.php index.html index.htm;
  
  ## Redirect Default Pages
      # error_page 404 /404.html;
  
  ## favicon.ico should not be logged
  location = /favicon.ico {
      log_not_found off;
      access_log off;
  }
  
  ## Deny all attempts to access hidden files such as .htaccess, .htpasswd, .DS_Store (Mac).
  location ~ /\. {
      deny all;
      access_log off;
      log_not_found off;
  }
  
  ## Deny all attems to access possible configuration files
  location ~ \.(tpl|yml|ini|log)$ {
      deny all;
  }
  
  ## XML Sitemap support.
  location = /sitemap.xml {
      log_not_found off;
      access_log off;
  }
  
  ## robots.txt support.
  location = /robots.txt {
      log_not_found off;
      access_log off;
  }
  
  location ~ \.php$ {
  #    try_files $uri $uri/ =404;
  
      ## NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
      fastcgi_split_path_info ^(.+\.php)(/.+)$;
  
      ## required for upstream keepalive
      # disabled due to failed connections
      #fastcgi_keep_conn on;
  
      include fastcgi_params;
      fastcgi_buffers 8 16k;
      fastcgi_buffer_size 32k;
  
      client_max_body_size 24M;
      client_body_buffer_size 128k;
  
      ## Timeout for Nginx to 5 min
      fastcgi_read_timeout 300;
  
      ## upstream "php-fpm" must be configured in http context
      fastcgi_pass php-fpm;
  }
  
  #URL Rewrite
  location / {
      try_files $uri $uri/ /index.php?$args;
  }
  </code></pre>
  
  <p>Any idea?</p>