# ========================================================= # GLKVM Cloud - Reverse Proxy Mode (Nginx Example) # # This configuration shows how to run GLKVM Cloud behind # Nginx in reverse proxy mode. # # - TLS is terminated by Nginx # - GLKVM Cloud listens on plain HTTP internally # - Web UI and remote device access share the same HTTPS port # - Routing is based on the requested domain name # ========================================================= # WebSocket connection helper map $http_upgrade $connection_upgrade { default upgrade; '' close; } # --- Web UI: https://www.example.com --- server { listen 443 ssl http2; server_name www.example.com; ssl_certificate /path/to/fullchain.pem; ssl_certificate_key /path/to/privkey.pem; ssl_session_cache shared:SSL:10m; ssl_session_timeout 10m; location / { proxy_http_version 1.1; # Required forwarded headers for reverse proxy mode proxy_set_header Host $host; proxy_set_header X-Forwarded-Host $host; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-Forwarded-Port $server_port; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; # WebSocket support proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection $connection_upgrade; # GLKVM Cloud web service (HTTP) proxy_pass http://127.0.0.1:1443; proxy_connect_timeout 10s; proxy_send_timeout 60s; proxy_read_timeout 60s; } } # --- Device Access: https://.example.com --- server { listen 443 ssl http2; server_name *.example.com; ssl_certificate /path/to/fullchain.pem; ssl_certificate_key /path/to/privkey.pem; ssl_session_cache shared:SSL:10m; ssl_session_timeout 10m; location / { proxy_http_version 1.1; # Required forwarded headers for reverse proxy mode proxy_set_header Host $host; proxy_set_header X-Forwarded-Host $host; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-Forwarded-Port $server_port; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; # WebSocket support proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection $connection_upgrade; # GLKVM Cloud device access service (HTTP) proxy_pass http://127.0.0.1:10443; proxy_connect_timeout 10s; proxy_send_timeout 60s; proxy_read_timeout 60s; } }