Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
2.8k views
in Technique[技术] by (71.8m points)

golang http keeplaive的疑问

场景:
nginx侧:

nginx作为proxy,然后后端是golang的http服务
nginx使用upstream配置了两台golang的http服务
nginx配置了keepalive_timeout

遇到的问题:
nginx的error信息里面报错: upstream server temporarily disabled while reading response header from upstream

这个问题是因为nginx 拿着连接去请求后端, 但是发现后端直接关闭连接.

我的疑问:
由此, 我想知道golang的http服务, 它的keepalive机制是怎样的? 目前我查阅资料仅仅看到怎么关闭keepalive,却没有看到配置keepalive的时间, 以及默认值


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

创建http client的时候,tls相关都可以设置


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...