[Freeswitch-users] WebSocket behind NGINX

Dan Edwards DEdwards at vertical.com
Mon Feb 1 17:34:42 MSK 2016


I'm also running behind Nginx and what I found worked was to proxy to the actual IP address (192.168.1.1 vs. 127.0.0.1), then explicitly removing 192.168.1.1 from the localnet ACL in acl.conf. I had to remove 192.168.1.1 from localnet so FS will offer external IP addresses for RTP. 


-----Original Message-----
From: freeswitch-users-bounces at lists.freeswitch.org [mailto:freeswitch-users-bounces at lists.freeswitch.org] On Behalf Of Anton
Sent: Saturday, January 30, 2016 2:20 PM
To: freeswitch-users at lists.freeswitch.org
Subject: [Freeswitch-users] WebSocket behind NGINX

Hello All,

I have to proxy all websocket requests though a nginx server. Right now I am using next configuration:

map $http_upgrade $connection_upgrade {
     default upgrade;
     ''      close;
}

server {
     listen 443;
     server_name  wss.somedomain.com.ua;

     ssl on;
     ssl_certificate      /etc/nginx/cert.pem;
     ssl_certificate_key  /etc/nginx/private.key;

     location / {
         proxy_pass http://127.0.0.1:5066;
         proxy_http_version 1.1;
         proxy_set_header Upgrade $http_upgrade;
         proxy_set_header Connection $connection_upgrade;
         proxy_read_timeout 86400s;
    }

     access_log /var/log/nginx/wss_access;
     error_log /var/log/nginx/wss_error debug; }

I dumped traffic from nginx and found out that "switching protocol" 
phrase was successful but INVITE message from my browser in pending state.
Maybe FreeSWITCH wants real IP not loopback? Who have faced with similar problem?

BR,
Anton

_________________________________________________________________________
Professional FreeSWITCH Consulting Services: 
consulting at freeswitch.org
http://www.freeswitchsolutions.com

Official FreeSWITCH Sites
http://www.freeswitch.org
http://confluence.freeswitch.org
http://www.cluecon.com

FreeSWITCH-users mailing list
FreeSWITCH-users at lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org



Join us at ClueCon 2016 Aug 8-12, 2016
More information about the FreeSWITCH-users mailing list