2013-03-09 2 views
1

로컬 컴퓨터에서 제대로 작동하는 토네이도 웹 소켓 서버가 있습니다. 하지만 웹 서버에 배포하고 supervisord로 실행하면 자바 스크립트 웹 소켓과 연결할 수 없습니다. 방화벽에서 포트를 열려고 시도했지만 작동하지 않습니다. 는 또한 nginx를 가진 프록시 (와 TCP 모듈)프록시가없는 Tornado WebSocket 서버

tcp { 
    upstream websockets { 
     server abc.de.efg.hij:23581; 
     check interval=3000 rise=2 fall=5 timeout=1000; 
    } 

    server { 
     listen abc.de.efg.hij:45645; 
     server_name _; 

     tcp_nodelay on; 
     proxy_pass websockets; 
    } 
} 

뿐만 아니라 나던 작품을 사용했습니다. 여기에 무슨 문제가 있습니까?

+0

시도를'haproxy'을 사용합니다. –

+0

이제 Nginx를 웹 소켓 용 역방향 프록시로 사용할 수 있습니다. 방법은 [proxying-websockets-with-nginx] (https://chrislea.com/2013/02/23/proxying-websockets-with-nginx/)를 참조하십시오. – xzvkm

답변

0

당신은 확실히 업그레이드 헤더가 제대로 전달되는지 확인하기 위해 웹 소켓을위한 별도의 '위치'섹션을 추가해야합니다

location /YOUR_SOCKET_ENDPOINT/ { 
    proxy_pass http://backend; 
    proxy_http_version 1.1; 
    proxy_set_header Upgrade $http_upgrade; 
    proxy_set_header Connection "upgrade"; 
} 

문서 도구 현재 위치 : http://nginx.org/en/docs/http/websocket.html

관련 문제