Websocket on port 80

trm asn trm.nagios at gmail.com
Mon Mar 4 19:50:31 UTC 2013

Hi List,

I am using Nginx-1.3.13 for this websocket support. I am doing
socket.ioproxy from Nginx . Below is my nginx.conf for websocket .

http {
        include       /etc/nginx/mime.types;
        default_type  application/octet-stream;

map $http_upgrade $conn_header {
 default upgrade;
 '' '';

server {
       listen         80;
        server_name _
                access_log  /var/log/nginx/access.log mylog;
                error_log  /var/log/nginx/error.log;
        root    /var/www/nginx;

        location /nodeapp {
               proxy_set_header X-Real-IP $remote_addr;
               proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_redirect off;
                proxy_http_version 1.1;
                proxy_set_header Upgrade $http_upgrade;
                proxy_set_header Connection $conn_header;
                 proxy_read_timeout 120s;
                proxy_set_header Host $host;

my-node logs ...

debug: got heartbeat packet
debug: cleared heartbeat timeout for client tZhwv5ng-YYkTREOHsh4
debug: set heartbeat interval for client tZhwv5ng-YYkTREOHsh4
info: stats: "stats key"
info: stats: "Sent gauge sessions.count with value 9"
info: stats: "stats key"
info: stats: "Sent gauge users.registered with value 3"
info: stats: "stats key"
info: stats: "Sent gauge sessions.unique with value 3"
info: transport end (socket end)

But if configure Nginx on SSL mode then  it's upgrading to websocket ( 101
) .

debug: client authorized
info: handshake authorized jthZZKLA1fR1eaHTHsih
debug: setting request GET /dkitserver/
debug: set heartbeat interval for client jthZZKLA1fR1eaHTHsih
debug: client authorized for
debug: websocket writing 1::
info: : "Session started for accessId: HbIzkBis5MYB9I7X"
debug: websocket writing 5:::{"name":"session-marked-as-alive"}

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20130305/6358f6e1/attachment.html>

More information about the nginx mailing list