Introduction
Although the HOOPS Visualize Web SC server can be configured with an HTTPS server as described in this article: HOOPS Visualize Web Server with HTTPS (SSL) , a non-standard port (11182) remains open to the internet, which poses a security risk. This port should be closed by restricting it to a private environment. It is important to minimizes exposure to the public network.
This article explains alternative way to configure SC server with HTTPS server by using an NGINX reverse proxy.
If you have not yet created an HTTPS server, please refer to the following article: How to setup HTTPS server with AWS
SDK / OS / server in use (version)
- HOOPS Visualize Web (2026.1.0)
- AWS Ubuntu Server (24.04 LTS)
- NGINX (1.24.0)
Instruction
HOOPS Visualize Web server installation
Place the folders and files required for the HVW server from the SDK.
Here is an illustration of how to configure the server:
var
βββ www
βββ html
β βββ demo-app
β βββ hoops-web-viewer.mjs
β βββ engine.esm.wasm
β βββ sample.html
βββ server
βββ 3rd_party
βββ sc_models
- Transfer the
tar.gzfile of HOOPS Visualize Web for Linux to the/tmpfolder of the virtual server via SCP - Extract the
tar.gzfile
cd /tmp
tar -zxvf HOOPS_Visualize_Web_202x.x.x_Linux_xxx.tar.gz
- Allocate the necessary folders in a root folder of NGINX
cd HOOPS_Visualize_Web_202x.x.x/
sudo cp -r 3rd_party/ server/ /var/www/
sudo cp -r quick_start/converted_models/standard/sc_models/ /var/www/
cd web_viewer/
sudo cp -r demo-app hoops-web-viewer.mjs engine.esm.wasm /var/www/html/
HOOPS Visualize Web server setup
- Open
Config.jsfor HOOPS Communicator Stream Cache Server
sudo vi /var/www/server/node/Config.js
- Set model search directory
modelDirs: [
"./sc_models",
],
- Save and quit:
:wq
Note that it is not necessary to set SSL settings of Config.js if reverse proxy is used. WSS requests are routed through and handled as WS requests by reverse proxy of NGINX before it reaches the SC server.
Edit inbound rules
- Edit the inbound rules of the virtual server so that HTTP (80), HTTPS (443) and SSH (22) ports are opened to the internet (Delete 11182 port)
Setting reverse proxy
- Open the NGINX setting file
sudo vi /etc/nginx/sites-enabled/default
- Add the following location under existing location / {β¦}
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ =404;
}
location /wsproxy/ {
rewrite /wsproxy/([^/]+) / break;
proxy_pass http://127.0.0.1:$1;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
location /httpproxy/ {
#Rewrite request URI (path), capturing some info in the process.
#Capture 1 = back-end server port. Capture 2 = back-end server path.
rewrite /httpproxy/([^/]+)/([^/]+) /$2 break;
#Proxy to the back end server
proxy_pass http://127.0.0.1:$1;
}
- Save and quit:
:wq
Add mjs extension to MIME types of NGINX
Adding mjs extension to MIME types since thereβs no entry for the mjs extension in NGINX βs default file type.
- Open the MIME types setting file
sudo vi /etc/nginx/mime.types
- Add
mjsextension to the js line
- Save and quit:
:wq
Note that if hoops-web-viewer.mjs is loaded without adding the mjs file type, the following error occurs:
Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of "application/octet-stream".
Reload NGINX
- Reload NGINX to apply the changed settings
sudo service nginx reload
Minimal sample viewer creation
Configure a proxy connection using a minimal HTML sample.
- Create a sample HTML and open
sudo touch /var/www/html/sample.html
sudo vi /var/www/html/sample.html
- Implement the following HTML
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8"/>
<title>Simple</title>
<style>
#container {
width:600px;
height:480px;
position:relative;
border: thin solid #000000;
}
</style>
<script type="importmap">
{
"imports": {
"@hoops/web-viewer": "/hoops-web-viewer.mjs"
}
}
</script>
<script type="module">
import {WebViewer} from "@hoops/web-viewer";
WebViewer.defaultEnginePath = "./";
</script>
<script type="module">
import { WebViewer } from "@hoops/web-viewer";
window.onload = function () {
const endpoint = "wss://" + window.location.hostname + "/wsproxy/11182";
const viewer = new WebViewer({
containerId: "container",
model: "microengine",
endpointUri: endpoint,
enginePath: "./"
});
viewer.start();
};
</script>
</head>
<body>
<div id="container"></div>
</body>
</html>
Note that 11180 port is specified with /wsproxy/ location. This /wsproxy/ location will be rewritten as ws://YOUR_DOMAIN_NAME:11182 by reverse proxy of NGINX.
- Save and quit:
:wq - Start the HOOPS Visualize Web server
cd /var/www/server/node
../../3rd_party/node/bin/node --expose-gc ./lib/Startup.js
- Open
https://YOUR_DOMAIN_NAME/sample.htmlusing your web browser to verify you have configured the proxy connections correctly
Edit sample viewer
If you want to use demo-app/index.html with reverse proxy, it is necessary to edit Router.js
- Open Router.js
sudo vi /var/www/html/demo-app/web-viewer-demo/src/app/Router.js
- Edit
:to/wsproxy/of thewsUriRootfunction
- Save and quit:
:wq - Start the HOOPS Visualize Web server
sudo sh /var/www/server/node/start_server.sh
- Open
https://YOUR_DOMAIN_NAME/demo-app/index.html?viewer=csr&model=arboleda&wsPort=11182using your web browser
HVW server start service
Make a service so that the HVW Server is started at boot time.
- Create a description file for service and open
sudo touch /etc/systemd/system/onboot.service
sudo vi /etc/systemd/system/onboot.service
- Write the following service description
[Unit]
Description=auto start commands in /etc/onboot.sh on boot
[Service]
Type=simple
ExecStart=/etc/onboot.sh
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target
-
Save and quit:
:wq -
Create a shell file for the service and open
sudo touch /etc/onboot.sh
sudo chmod 0755 /etc/onboot.sh
sudo vi /etc/onboot.sh
- Write the following shell command to start the server
#!/bin/bash
cd /var/www/server/node
../../3rd_party/node/bin/node --expose-gc ./lib/Startup.js
-
Save and quit:
:wq -
Verify the service is registered
sudo systemctl list-unit-files --type=service | grep onboot.service
- Enable the service to start automatically
sudo systemctl enable onboot.service
- Restart the virtual server and verify whether HOOPS Visualize Web Server is started automatically
sudo systemctl status onboot.service
- Reload the URL of sample the HTML (
http://xxx.xxx.xxx.xxx/sample.html) in your web browser to verify you have configured HVW Server to automatically start as a service correctly







