Setup was pretty straightforward with some home networking. I run a couple different websites, so a proxy web server was mandatory given I only have one assigned external ip address.
I'd like to share just a couple areas where clarity could be better:
- The READ_WRITE url is hosted at <address>:8081/live.html but the READ-ONLY url is hosted at <address>:8082/live.html. If you want to disable end-users from modifying your configuration, this is mandatory.
- The API is exposed at <address>:8080, so it's very important this path is not exposed to end-users.
For web server, I'm using a ubuntu nginx configuration with proxy-pass enabled so that the connection upgrades from http -> https and ws -> wss.
If you're going to do https/wss, you need to have signed certificates for your chosen domain. I elect to self-sign mine, and purchase/manage the domains at CloudFlare. There's a good tutorial on how to do this authored for some unrelated software. But following the steps on this page will get you where you need to be:
https://pterodactyl.io/tutorials/creating_ssl_certificates.html#method-2:-acme.sh-(using-cloudflare-api)
And here's my nginx configuration below. You'll need to replace "kn0.app" with your domain, and "192.168.0.99" with the location of the Inovate HamClock on your local network. This configuration redirects http/ws connections to a secure https/wss variant:
server {
listen 80;
listen [::]:80;
server_name kn0.app;
return 301 https://$server_name$request_uri;
}
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name kn0.app;
sendfile off;
# SSL Configuration
ssl_certificate /etc/letsencrypt/live/kn0.app/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/kn0.app/privkey.pem;
ssl_session_cache shared:SSL:10m;
ssl_protocols TLSv1.2 TLSv1.3;
ssl_ciphers "ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384";
ssl_prefer_server_ciphers on;
# ---------------------------
# Security Headers
# ---------------------------
add_header X-Content-Type-Options nosniff;
add_header X-XSS-Protection "1; mode=block";
add_header X-Robots-Tag none;
add_header Content-Security-Policy "frame-ancestors 'self'";
add_header X-Frame-Options DENY;
add_header Referrer-Policy same-origin;
# ---------------------------
# Serve the HTML file
# ---------------------------
location / {
proxy_pass http://192.168.0.99:8082/live.html;
proxy_set_header Host $host;
}
# ---------------------------
# WebSocket Proxy (ws → wss)
# ---------------------------
location /live-ws {
proxy_pass http://192.168.0.99:8082/live-ws;
# WebSocket support
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
# Pass headers so the upstream sees the correct host/address
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}Make sure to enable this configuration with:
sudo ln -s /etc/nginx/sites-available/<REPLACE>.conf /etc/nginx/sites-enabled/<REPLACE>.conf
systemctl restart nginx
Finally, make sure to go into your Router's settings and port forward the 80/http and 443/https and ports with tcp. Point the A root record for your domain at your external ip (Google "What's my IP"). Hopefully your ISP offers a static ip that doesn't change over a dynamic one that changes often.
73