Sto usando nginx version: nginx/1.0.12
Nginx TCP (WebSockets) Timeout/Keepalive Config
mio nginx.conf assomiglia a questo:
#user nobody;
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;
}
tcp {
upstream websockets {
## Play! WS location
server 127.0.0.1:9000;
check interval=3000 rise=2 fall=5 timeout=1000;
}
server {
listen 80;
listen 8000;
server_name socket.domain.com;
tcp_nodelay on;
proxy_pass websockets;
proxy_send_timeout 300;
}
# virtual hosting
#include /usr/local/nginx/vhosts/*;
}
mia domanda sembra essere caduta COLLEGAMENTI DI websocket ogni 75 secondi (o giù di lì) che penso sia dovuto alla configurazione keepalive predefinita di Nginx. Come aumentare il timeout?
Grazie
Controllare [wiki] (http://nginx.org/en/docs/http/ngx_http_upstream_module.html#keepalive). –
Avevo provato prima: ho aggiunto keepalive 32 alla riga 20 (sotto il server 127.0.0.1:9000) e ottengo nginx: [emerge] direttiva sconosciuta "keepalive" in /usr/local/nginx/conf/nginx.conf: 20 –
@DmitryPaskal, se rimuovo la direttiva upstream (non sono ancora in grado di bilanciare il carico) e aggiungo un passaggio proxy nel tag del server, allora cosa dovrei fare? –