Posted at

Nginx + GoFCGIでreadv() failed (104: Connection reset by peer) while reading upstream

More than 3 years have passed since last update.

Nginx

upstream container-sentry { server go:9000; }

location / {
proxy_set_header Host $host;
fastcgi_pass container-sentry;
include fastcgi_params;
break;
}

Go

listener, _ := net.Listen("tcp", ":9000")

fcgi.Serve(listener, nil)

いろいろ端折ってますが、こんなかんじで動かしてた時

readv() failed (104: Connection reset by peer) while reading upstream

とおこなれ何これ?何文句あるの?

ッて思ってたけど

location / {                       

proxy_set_header Host $host;
fastcgi_pass container-sentry;
+ fastcgi_keep_conn on;
include fastcgi_params;
break;
}

で、かいけつ