Summary

RemoteViz uses WebSocket protocol to make possible the communication between the client and the service. Without any web servers between the client and the RemoteViz service, a WebSocket connection can be established smoothly. However, in production environments, the web page requests are handled by a web server and only the web server port (port 80 by default) is open from the outside in order to guarantee security. To use the same port and domain for the HTTP requests and the Websocket requests, the websocket traffic has to be routed through the web server. This document explains how to configure NGinx server as reverse proxy to handle web page requests and websocket traffic over the same port and domain.

Compatibility

Nginx server supports Websocket proxing from the version 1.3.13.

NGinx Installation

NGinx Configuration

In the next section, we consider that the NGinx web server is bound to the public port 80 (non-SSL) or 443 (SSL) and the RemoteViz service is bound to the private port 8080 (behind a firewall). Inside the website configuration file, add a "location" block. This block describes how Websocket requests are handled. Here is an example of the configuration that is used to handle the WebSocket requests directed at "/RemoteViz". Each HTTP requests containing "/RemoteViz" in the URL will be considered as a Websocket connection and will be redirected to port 8080.