# Websocket on port 80

**URL:** <https://www.ruby-forum.com/t/websocket-on-port-80/227116>\
**Category:** NGINX\
**Created:** [March 4, 2013, 8:50pm UTC](https://www.ruby-forum.com/t/websocket-on-port-80/227116 "2013-03-04T20:50:57Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![trm\_asn](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/7993a0/32.png) [@trm\_asn](https://www.ruby-forum.com/u/trm_asn)\
**Post date:** [March 4, 2013, 8:50pm UTC](https://www.ruby-forum.com/t/websocket-on-port-80/227116/1 "2013-03-04T20:50:57Z")

</div>

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\_pass [http://10.164.110.11:8888](http://10.164.110.11:8888);  
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/  
[socket.io/1/websocket/jthZZKLA1fR1eaHTHsih](http://socket.io/1/websocket/jthZZKLA1fR1eaHTHsih)  
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”}

–Thanks,  
Tarak

---

<div class="post-metadata">

**Author:** ![trm\_asn](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/7993a0/32.png) [@trm\_asn](https://www.ruby-forum.com/u/trm_asn)\
**Post date:** [March 5, 2013, 8:55pm UTC](https://www.ruby-forum.com/t/websocket-on-port-80/227116/2 "2013-03-05T20:55:44Z")

</div>

On Tue, Mar 5, 2013 at 1:20 AM, trm asn [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> default upgrade;  
> location /nodeapp {  
> }  
> info: stats: “stats key”  
> debug: setting request GET /nodeapp/  
> [socket.io/1/websocket/jthZZKLA1fR1eaHTHsih](http://socket.io/1/websocket/jthZZKLA1fR1eaHTHsih)  
> 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”}
> 
> –Thanks,  
> Tarak

Does anybody has faced this issue with 1.3.13 & [socket.io](http://socket.io) .
