nginx 速度慢, 有的图片能读取,有的不能,

zhg115 2016-09-29 04:23:17
nginx 速度慢, 有的图片能读取,有的不能,但是同样的部署文件在本地测试速度快。

本地 : win10 , 服务器 : win2008R2

本体跟服务器还有不一样的话,服务器里安装了 IIS7.
求大牛解答。 下面nginx.conf 代码


#user nobody;
worker_processes 1;

#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;

#pid logs/nginx.pid;


events {
worker_connections 65535;
}


http {
include mime.types;
default_type application/octet-stream;


charset utf-8;

#access_log logs/access.log main;

sendfile on;


keepalive_timeout 65;


gzip on;
gzip_min_length 1000;
gzip_types text/plain text/css application/x-javascript;

proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_redirect off;
client_max_body_size 1000M;
client_body_buffer_size 256k;
proxy_connect_timeout 600;
proxy_send_timeout 600;
proxy_read_timeout 6000;
proxy_buffer_size 128k;
proxy_buffers 4 256k;
proxy_busy_buffers_size 256k;
proxy_temp_file_write_size 1024k;

upstream localhost {
server localhost:8080;
}

server {
listen 80;
server_name localhost;

#charset koi8-r;

#access_log logs/host.access.log main;


location / {
root /root;
index index.jsp index.html index.htm;
proxy_pass http://localhost;
}

error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}


location ~* \.(?:jpg|jpeg|gif|png|ico|cur|gz|svg|svgz|mp4|ogg|ogv|webm|htc)$ {
expires 15d;
access_log off;
#add_header Cache-Control "public";
break;
}

location ~ .*\.(js|css)?$
{
expires 1d;
access_log off;
#add_header Cache-Control "public";
break;
}
}

}
...全文
552 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
zhg115 2016-09-30
  • 打赏
  • 举报
回复
找到错误了 upstream localhost { server localhost:8080; } 改成 server 127.0.0.1:8080

5,655

社区成员

发帖
与我相关
我的任务
社区描述
Web开发应用服务器相关讨论专区
社区管理员
  • 应用服务器社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧