Beranda
Fix Zima VM Web Console via Cloudflare Tunnel Using NGINX Stream (Port 5700)
Fix Zima VM Web Console via Cloudflare Tunnel Using NGINX Stream (Port 5700)

Fix Zima VM Web Console via Cloudflare Tunnel Using NGINX Stream (Port 5700)

Khaidir Fahram 07 Apr 2026 Note 67 Views

Pada setup saya, saya menggunakan:

  • ZimaOS (Zima Virtual Machine)

  • NGINX Proxy Manager (Docker)

  • Cloudflare Tunnel (untuk expose HTTP)

  • Domain: wos.my.id

Saya mengalami masalah ketika mengakses VM Console (WebSocket), meskipun Web UI ZimaOS berjalan normal.


1. Permasalahan yang Saya Temui

Web UI bisa diakses:

https://wos.my.id

Namun saat membuka console VM, muncul error:

WebSocket connection failed

Setelah saya analisa, ternyata:

  • ZimaOS Web UI → menggunakan HTTP (port 88)

  • VM Console → menggunakan WebSocket di port 5700

  • Cloudflare Tunnel hanya handle HTTP/HTTPS (Layer 7)

  • Port 5700 tidak ter-handle oleh Cloudflare


2. Root Cause

Ketika console dibuka, browser mencoba koneksi:

wss://wos.my.id:5700/

Masalahnya:

  • Cloudflare (mode proxy/orange cloud) tidak support port 5700

  • Tunnel hanya meneruskan HTTP, bukan TCP raw

  • WebSocket console membutuhkan koneksi persistent TCP


3. Solusi yang Saya Gunakan

Saya pisahkan jalur traffic:

  • HTTP (Web UI) → tetap lewat Cloudflare Tunnel

  • WebSocket (5700) → direct TCP via NGINX Stream


4. Konfigurasi yang Saya Lakukan

4.1 NGINX Proxy Manager (HTTP)

Saya buat Proxy Host:

  • Domain:

    wos.my.id
  • Forward ke:

    172.22.0.1:88
  • Enable:

    • WebSocket Support

    • Block Common Exploits

    • Cache Assets

Hasil:

https://wos.my.id → ZimaOS Web UI

4.2 Cloudflare Tunnel

Saya setup:

  • Service: HTTP

  • Target:

    http://127.0.0.1:80

Ini hanya untuk Web UI.


4.3 NGINX Stream (Bagian Paling Penting)

Saya masuk ke:

NGINX Proxy Manager → Streams → Add Stream

Lalu saya isi:

  • Incoming Port:

    5700
  • Forward Host:

    wos.my.id

    (atau IP lokal server)

  • Forward Port:

    5700
  • Protocol:

    • TCP: ON

    • UDP: OFF

Kemudian Save.


5. Hasil Akhir

Setelah semua konfigurasi:

  • Web UI tetap berjalan via Cloudflare

  • Console VM sekarang berhasil terbuka

  • Tidak ada lagi error WebSocket


6. Alur Arsitektur yang Saya Gunakan

[Browser]
   |
   | HTTPS
   v
[Cloudflare Tunnel]
   |
   v
[NGINX Proxy :80]
   |
   v
[ZimaOS :88]


[Browser]
   |
   | TCP 5700
   v
[NGINX Stream :5700]
   |
   v
[Zima VM Console]

7. Kenapa Solusi Ini Berhasil

Sebelumnya saya mencoba semua lewat HTTP (Layer 7), tapi gagal karena:

  • WebSocket butuh koneksi persistent

  • Reverse proxy HTTP bisa merusak upgrade connection

Dengan NGINX Stream:

  • Saya bypass Layer 7

  • Traffic langsung TCP (Layer 4)

  • Tidak ada manipulasi header

  • WebSocket berjalan stabil