Try Cloudflare Tunnel via random subdomain
https://github.com/cloudflare/cloudflared#trycloudflare
https://developers.cloudflare.com/cloudflare-one/connections/connect-apps/do-more-with-tunnels/trycloudflare/
https://developers.cloudflare.com/cloudflare-one/connections/connect-apps/install-and-setup/installation/
Install
wget https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-x86_64.rpm
sudo dnf install cloudflared-linux-x86_64.rpm
# or
wget https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-amd64.deb
sudo dpkg -i cloudflared-linux-amd64.deb
Start
cloudflared tunnel --url http://example-host:8086
# or
nohup cloudflared tunnel --url http://example-host:8086 &> cft.log &
With Host
sudo vim /etc/hosts
Add
127.0.0.1 example-host
Nginx
server {
gzip on;
gzip_disable "msie6";
client_max_body_size 150m;
listen 8086;
server_name example-host;
root /usr/share/nginx/html/example_files;
location /ws_path {
if ($http_upgrade != "websocket") {
return 404;
}
proxy_redirect off;
proxy_pass http://127.0.0.1:9999;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}