Nginx always can't finish loading pictures. What's going on?

Server bandwidth 1m I casually wrote a page test in which I put ten pictures each with a size of more than 100 kb. Every time I opened the page, the first few pictures were loaded at a normal speed, and three or four images could not be loaded for a long time until finally, the nginx could not be loaded. The following is the configuration of nginx is my nginx configuration is not correct? Other configurations create a new test.conf

under the conf.d directory untouched.

test.conf

server {
  server_name ***.com;
  root /var/www/html/test;
  index 1.html;
  location ~* ^.+\.(jpg|jpeg|gif|png|ico|css|js|pdf|txt){
    root /var/www/html/test;
  }
}

nginx.conf

http {

    -sharp-sharp
    -sharp Basic Settings
    -sharp-sharp

    sendfile on;
    tcp_nopush on;
    tcp_nodelay on;
    keepalive_timeout 65;
    types_hash_max_size 2048;
    -sharp server_tokens off;

    -sharp server_names_hash_bucket_size 64;
    -sharp server_name_in_redirect off;

    include /etc/nginx/mime.types;
    default_type application/octet-stream;

    -sharp-sharp
    -sharp SSL Settings
    -sharp-sharp

    ssl_protocols TLSv1 TLSv1.1 TLSv1.2; -sharp Dropping SSLv3, ref: POODLE
    ssl_prefer_server_ciphers on;

    -sharp-sharp
    -sharp Logging Settings
    -sharp-sharp

    access_log /var/log/nginx/access.log;
    error_log /var/log/nginx/error.log;

    -sharp-sharp
    -sharp Gzip Settings
    -sharp-sharp

    gzip on;
    gzip_disable "msie6";

    -sharp gzip_vary on;
    -sharp gzip_proxied any;
    -sharp gzip_comp_level 6;
    -sharp gzip_buffers 16 8k;
    -sharp gzip_http_version 1.1;
    -sharp gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;

    -sharp-sharp
    -sharp Virtual Host Configs
    -sharp-sharp

    include /etc/nginx/conf.d/*.conf;
    include /etc/nginx/sites-enabled/*;
}
Jun.29,2022

favicon.ico is the icon in front of your browser's address bar.
will look in the root directory of your website by default.

for images that cannot be loaded, you can check Network in browser F12 to find the request to open in the new tab.


clear the browser cache, and then grab the chrome developer tool to check the image request status 200 and download status. You can also check access.log to see the returned status

 log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                  '$status $body_bytes_sent "$http_referer" '
                  '"$http_user_agent" "$http_x_forwarded_for"';
            
            
               

by the way, enable buffer,5s strong brushing into log

access_log /var/log/nginx/access.log main buffer=32k flush=5s;
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e8e654-11ce.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e8e654-11ce.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?