@Feng_Yu 你好,想跟你请教个问题:* About to connect() to xxx.xxx.com port 80 (#0)
* Trying xxx.xxx.x.xxx...
* Connected to sdk.myee7.com (xxx.xxx.x.xxx) port 80 (#0)
> GET /devResource/2017061205500495320.zip HTTP/1.1
> User-Agent: curl/7.29.0
> Host: xxx.xxx.com
> Accept: */*
>
< HTTP/1.1 200 OK
< Server: nginx/1.9.1
< Date: Fri, 16 Jun 2017 06:52:20 GMT
< Content-Type: application/zip
< Content-Length: 73168530
< Connection: keep-alive
< Last-Modified: Mon, 12 Jun 2017 05:50:04 GMT
< ETag: "593e2b8c-45c7692"
< Accept-Ranges: bytes
<
{ [data not shown]
* transfer closed with 73057469 bytes remaining to read
* Closing connection 0
xx.x.x.x--[16/Jun/2017:07:29:45+0000]"GET/devResource/2017061205500495320.zipHTTP/1.0"200257298"-""Mozilla/5.0(WindowsNT10.0;WOW64)AppleWebKit/537.36(KHTML,likeGecko)Chrome/57.0.2987.98Safari/537.36"
这个是我文件所在的服务器的nginx的access.log,没有error.log,然后可以对外访问的那个服务器,我配置反向代理的那个,没有产生任何日志。
user nobodynobody;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 1024; useepoll;}http{# includephpconfig.conf; includemime.types; proxy_bufferingoff; default_type application/octet-stream; gzipon; gzip_min_length1k; gzip_buffers416k; #gzip_http_version1.0; gzip_comp_level4; gzip_typestext/plainapplication/x-javascripttext/cssapplication/xmltext/javascriptimage/jpegimage/gifimage/pngapplication/javascript; gzip_varyoff; #gzip_disable"MSIE[1-6]\."; #log_format main '$remote_addr-$remote_user[$time_local]"$request"' # '$status$body_bytes_sent"$http_referer"' # '"$http_user_agent""$http_x_forwarded_for"'; #access_log logs/access.log main; sendfile on; #tcp_nopush on; #keepalive_timeout 0; keepalive_timeout 65; underscores_in_headerson; map$http_upgrade$connection_upgrade{ defaultupgrade; ''close; } server{ listen 80; server_namewww.myee.online; #charsetutf8; #access_log logs/host.access.log main; location/{ indexindex.html; root/opt/program/sdk_resource; index index.htmlindex.htm; try_files$uri$uri//index.html; } //配置反向代理的地方 location/devResource{ proxy_passhttp://10.0.0.6/devResource; } location/testDownload{ root/mnt/pluginportal; } location/sdk{ proxy_passhttp://10.0.0.6:9090/sdk; proxy_http_version1.1; proxy_set_headerUpgrade$http_upgrade; proxy_set_headerX-Real-IP $remote_addr; proxy_set_headerConnection$connection_upgrade; client_max_body_size 500m; } }}
回复 @sparic:当然不可能了。肯定是你哪里配置有问题回复 @Feng_Yu:会不会是反向代理其他服务器上的文件,下载的时候就是会这样的啊,我之前有个项目挂盘就没问题的,但这个项目没法挂盘回复 @Feng_Yu:只有access.log有记录生成,error.log没有日志那看看被代理的后端服务器的accesslog和errorlog呢?有什么发现?是不是被代理的后端服务器断开了请求,应该有log记录
10.0.0.4--[16/Jun/2017:08:09:48+0000]"GET/devResource/2017061205500495320.zipHTTP/1.0"200278388"-""Mozilla/5.0(WindowsNT10.0;WOW64)AppleWebKit/537.36(KHTML,likeGecko)Chrome/57.0.2987.98Safari/537.36"
10.0.0.4--[16/Jun/2017:08:12:41+0000]"GET/devResource/2017061205500495320.zipHTTP/1.0"200284012"-""Mozilla/5.0(WindowsNT10.0;WOW64)AppleWebKit/537.36(KHTML,likeGecko)Chrome/57.0.2987.98Safari/537.36"
确认下后端的服务有没有这个问题,在你的反向代理服务器上执行curl-svLOhttp://10.0.0.6/devResource/2017061205500495320.zip,也就是跳过代理,直接请求后端的资源,看看是否有这个问题?先确认是不是网络环境或后台服务器本身配置问题导致的。
帖子的回复里有反馈结果试了下,好像是正常的反馈了*Abouttoconnect()to10.0.0.6port80(#0)
* Trying10.0.0.6...
*Connectedto10.0.0.6(10.0.0.6)port80(#0)
>GET/devResource/2017061205500495320.zipHTTP/1.1
>User-Agent:curl/7.29.0
>Host:10.0.0.6
>Accept:*/*
>
<HTTP/1.1200OK
<Server:nginx/1.9.1
<Date:Fri,16Jun201709:08:45GMT
<Content-Type:application/zip
<Content-Length:73168530
<Last-Modified:Mon,12Jun201705:50:04GMT
<Connection:keep-alive
<ETag:"593e2b8c-45c7692"
<Accept-Ranges:bytes
<
{[datanotshown]
*Connection#0tohost10.0.0.6leftintact
[crit]37598#0:*10open()"/opt/webserver/nginx/proxy_temp/2/00/0000000002"failed(13:Permissiondenied)whilereadingupstream,client:xx.xxx.xxx.xxx,server:www.xxx.xxx,request:"GET/devResource/2017061205500495320.zipHTTP/1.1",upstream:"http://内网IP:80/devResource/2017061205500495320.zip",host:"xxx.xxxx.com"
我感觉你的反向代理配置有问题,这个错误是由于下载的容量和httpheader显示的content-length头不符,content-length显示这个资源有73168530字节,你只下载了73168530-73057469字节就中断了。去看看反向代理服务器的errorlog,是否有什么发现?另外你可以把你的nginx配置贴出来看看
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。