Nginx configuration for the Tornado websocket demo?

Can someone please provide me with Nginx configuration for the Tornado websocket chat demo? the demo is located under /tornado/demos/websocket...

Answers


A config like this will work:

events {
    worker_connections  1024;
}

http {
    upstream chatserver {
        server 127.0.0.1:8888;
    }

    server {
        # Requires root access.
        listen       80;

        # WebSocket.
        location /chatsocket {
            proxy_pass http://chatserver;
            proxy_http_version 1.1;
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection "upgrade";
        }

        location / {
            proxy_pass http://chatserver;
        }
    }
}

You'll need to run Nginx as root in order to listen on port 80. Now you can visit "localhost" with your browser. More info on Nginx and websockets here.


Need Your Help

CGImageRef to UIImage rotates my photos debugging on a iOS 4 in simulator or device

iphone objective-c uiimage ios4

I have a problem with some simple code. The photo's, either picked or taken with the camera, are rotated. At first I thought it was a setting in the UIView but it happens when I copy the passed in

uitableview not showing data

iphone uitableview sqlite ios-simulator

i followed the tutorial -> http://icodeblog.com/2008/09/02/iphone-programming-tutorial-creating-a-todo-list-using-sqlite-part-2/