CTmine-client/docker/nginx.conf
Tronax b8a99e6e9e
Initial commit: CTmine-client (ContainerMine Client)
Docker-WebApp, die einen echten Minecraft Java-Client (Prism Launcher)
in einem Container mit virtuellem Display betreibt und per noVNC im
Browser anzeigt. Gedacht, um Accounts AFK an Farmen zu stellen.

- Multi-Stage Dockerfile: Vite/Vue-Build + Ubuntu-Runtime (Xvfb, x11vnc,
  websockify, noVNC, openbox, nginx, Prism Launcher 11.0.3)
- Vue 3 + Vite + TypeScript Dashboard (noVNC-iframe, Start/Stop,
  Status-Anzeige, Schnellstart-Anleitung)
- Node-Status-API ohne externe Dependencies (/api/status, /api/mc/*)
- docker-compose.yml mit PUID/PGID, konfigurierbarer Auflösung, shm_size
- Persistente Accounts/Instanzen in /config (Volume)
2026-08-08 21:08:51 +02:00

66 lines
1.9 KiB
Nginx Configuration File

# CTmine-client nginx-Konfiguration.
# Liefert das gebaute Vue-Dashboard aus und proxyt API + VNC-WebSocket.
user ctmine;
worker_processes 1;
pid /run/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
access_log /dev/stdout;
error_log /dev/stderr warn;
sendfile on;
keepalive_timeout 65;
client_max_body_size 4m;
server {
listen 8080 default_server;
listen [::]:8080 default_server;
server_name _;
root /var/www/ctmine;
index index.html;
# --- Vue SPA: Fallback auf index.html ---------------------------
location / {
try_files $uri $uri/ /index.html;
}
# --- noVNC-Webclient (vom novnc-Debian-Paket unter /usr/share/novnc) -
# Der VncViewer-iframe lädt /novnc/vnc.html und verbindet sich dann
# selbsttätig über /websockify (s.u.).
location /novnc/ {
alias /usr/share/novnc/;
try_files $uri $uri/ =404;
}
# --- Status-/Steuerungs-API → Node ------------------------------
location /api/ {
proxy_pass http://127.0.0.1:3000;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
# --- VNC über WebSocket (websockify lauscht auf :6080) ----------
# Wichtig: Upgrade-Header weiterreichen, sonst kein WS-Handshake.
location /websockify {
proxy_pass http://127.0.0.1:6080;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
proxy_read_timeout 3600s;
proxy_send_timeout 3600s;
}
}
}