js加载超时 nginx静态资源

server {
        listen       80;
        server_name  www.example.com;
        client_max_body_size 20M;
        root   /xxx/xxx;//项目路径
        
          
        location ~ .*.(html|htm|gif|jpg|jpeg|png|bmp|swf)$ {
             root /xx/xx;//路径
             expires 30d;//缓存时间
        }
          
        location ~ .*.(js|css)?$ {
            expires 1h;
        }

        location / {
           index index.html;
           proxy_pass http://localhost:8080;
       }
    }

使用nginx访问静态资源

请勿一次性加载超多图片!!!   会导致js加载超时

使用时才加载图片最好

原文地址:https://www.cnblogs.com/zimublog/p/10044199.html