Assume that you would like to set up Chatplus with 2 subdomains chat.yourdomain.com and voip.yourdomain.com . Here are NginX configurations for ChatPlus:
Chat
upstream chat_backend { server 127.0.0.1:3000; } # HTTPS Server server { server_name chat.yourdomain.com; # You can increase the limit if your need to. client_max_body_size 200M; error_log /var/log/nginx/chat.yourdomain.com.error.log; add_header Accept-Ranges bytes; location / { proxy_pass http://chat_backend/; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; proxy_set_header Host $http_host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forward-Proto http; proxy_set_header X-Nginx-Proxy true; proxy_force_ranges on; proxy_redirect off; } listen 80; }
Video Bridge
upstream voip_backend { server 127.0.0.1:8443; } # VoIP server server { server_name voip.yourdomain.com; # You can increase the limit if your need to. client_max_body_size 200M; error_log /var/log/nginx/voip.yourdomain.com.error.log; location / { proxy_pass https://voip_backend/; proxy_http_version 1.1; proxy_set_header Host $http_host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Nginx-Proxy true; proxy_redirect off; } location /xmpp-websocket { proxy_pass https://voip_backend/xmpp-websocket; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; } location /colibri-ws/ { proxy_pass https://voip_backend/colibri-ws/; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; } listen 80; }