我正在开发一个也被iOS应用程序使用的Ruby和Rails应用程序。在应用程序中有一个聊天功能。用户可以录制他的声音并将其发送给其他用户。
网络界面工作正常,用户" A"可以录制他的声音并将其发送给另一个用户" B&#34 ;;但在iOS上用户" A"正在录制他的声音并发送给用户" B"然后发生以下错误:
2018/06/18 12:28:33 [error] 21080#0: *8 recv() failed (104: Connection reset by peer) while reading upstream, client: XX.X.X.X, server: X.X.X.X, request: "PUT /api/v1/=65 HTTP/1.1", upstream: "passenger:unix:/tmp/passenger.LSZ265t/agents.s/core:", host: "xyz"
nginx.conf:
worker_processes 4;
events {
worker_connections 1024;
}
worker_rlimit_nofile 1024;
http {
passenger_root /home/ubuntu/.rvm/gems/ruby-2.4.0/gems/passenger-
5.2.0;
passenger_ruby /home/ubuntu/.rvm/gems/ruby-2.4.0/wrappers/ruby;
include mime.types;
default_type application/octet-stream;
sendfile on;
client_max_body_size 200M;
#tcp_nopush on;
#keepalive_timeout 0;
keepalive_timeout 128;
#gzip on;
server_names_hash_bucket_size 64;
client_header_timeout 3000;
client_body_timeout 3000;
fastcgi_read_timeout 3000;
fastcgi_buffers 8 128k;
fastcgi_buffer_size 128k;
server {
listen 80;
listen 443;
ssl on;
ssl_certificate_key server.key;
add_header Strict-Transport-Security max-age=31536000;
ssl_protocols TLSv1.2;
server_name X.X.X.X;
passenger_enabled on;
rails_env production;
root xyz/public;
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
}
以下是iOS日志:
Data]: 407 bytes
[Result]: FAILURE: Error Domain=NSURLErrorDomain Code=-1005 "The network connection was lost." UserInfo={NSUnderlyingError=0x604000446990 {Error Domain=kCFErrorDomainCFNetwork Code=-1005 "(null)" UserInfo={NSErrorPeerAddressKey=<CFData 0x600000493bf0 [0x11132dc80]>{length = 16, capacity = 16, bytes = 0x100201bb34089b100000000000000000}, _kCFStreamErrorCodeKey=57, _kCFStreamErrorDomainKey=1}}, NSErrorFailingURLStringKey=https://xyz, NSErrorFailingURLKey=https://xyx/api/v1/, _kCFStreamErrorDomainKey=1, _kCFStreamErrorCodeKey=57, NSLocalizedDescription=The network connection was lost.}
[Timeline]: Timeline: { "Request Start Time": 551017701.837, "Initial Response Time": 551017702.737, "Request Completed Time": 551017713.490, "Serialization