ITPub博客

首页 > > > nginx报错:WSARecv() failed

nginx报错:WSARecv() failed

作者:R-B 时间:2019-09-09 16:30:26 0 删除 编辑

nginx报错:WSARecv() failed (10054: An existing connection...



详细信息为:

2019/09/07 16:08:23 [error] 4860#7928: *1 WSARecv() failed (10054: An existing connection was forcibly closed by the remote host) while reading response header from upstream, client: 192.168.2.215, server: 192.168.2.200, request: "GET /index.html HTTP/1.1", upstream: "http://192.168.2.200:61003/index.html", host: "192.168.2.200"。

http://192.168.2.200:61003/index.html,这个可以正常访问。

配置为:

http {

include mime.types;

default_type application/octet-stream;

#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;

upstream server1 {   
  #ip_hash;
  server 192.168.2.200:61003;
  server 192.168.2.200:61001;
}

#gzip  on;

server {
    listen       80;
    server_name  192.168.2.200;

    #charset koi8-r;

    #access_log  logs/host.access.log  main;



    location / {  
#root   html;
#index  index.html index.htm;

    proxy_pass http://server1; 
    #proxy_set_header   Connection keep-alive;
#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_set_header Connection keep-alive;,这个加上就好了


来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/4560/viewspace-3141090/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2019-09-03

  • 博文量
    183
  • 访问量
    10919