NGINX | NetworkError:401未经授权~但它能工作吗?

NGINX | NetworkError:401未经授权~但它能工作吗?,nginx,http-status-code-401,Nginx,Http Status Code 401,我有一个非常奇怪的问题,主要是关于图像,有时还有URL。(在我的NGINX设置中) 有时我在Firebug控制台中发现以下消息: "NetworkError: 401 Unauthorized - http://myproject.mydomain.com/images/20150812/sample1.png" 或 但奇怪的是,这些东西都装了!没有丢失任何东西。所以我对这个错误消息有点困惑 配置: 我的项目文件位于“站点可用”和“站点启用” server { listen 80;

我有一个非常奇怪的问题,主要是关于图像,有时还有URL。(在我的NGINX设置中)

有时我在Firebug控制台中发现以下消息:

"NetworkError: 401 Unauthorized - http://myproject.mydomain.com/images/20150812/sample1.png"

但奇怪的是,这些东西都装了!没有丢失任何东西。所以我对这个错误消息有点困惑

配置:

我的项目文件位于“站点可用”和“站点启用”

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;


}
dev.conf

## 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;
}
有什么想法吗

## 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;
}