nginx: websockets

Since version 1.3.13 nginx has support websockets (WS).

To enable support of WS you should accept and proxy hop-by-hop 'upgrade' header. There is simple example.

cat << EOF > /etc/nginx/conf.d/ws.conf  
server {  
    listen       80 default;
    access_log /var/log/nginx/access.log main;
    error_log  /var/log/nginx/error.log  warn;

    location / {
        proxy_set_header Host $host;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header X-Real-IP $remote_addr;