fix(debug-ws): route via /admin/ws/debug/ so Angie forwards correctly

This commit is contained in:
Mitchell R 2026-05-22 20:28:26 +02:00
parent aff76b41f9
commit 31ba05b703
No known key found for this signature in database
2 changed files with 7 additions and 5 deletions

View file

@ -63,14 +63,16 @@ server {
proxy_send_timeout 86400s;
}
# Admin debug WS (journal + terminal) — authenticated via API key in query.
location /ws/admin/debug/ {
proxy_pass http://betterframe_ws;
# Admin debug WS (journal + terminal) under /admin/ so Angie's existing
# /admin/* routing applies. Proxied to coordinator-ws (18082) not admin-http.
location /admin/ws/debug/ {
proxy_pass http://betterframe_ws/ws/admin/debug/;
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 Cookie $http_cookie;
proxy_read_timeout 86400s;
proxy_send_timeout 86400s;
}

View file

@ -1743,7 +1743,7 @@ export function registerAdminRoutes(app: H3, deps: AdminDeps): void {
function connect(){
// WS to coordinator — proxied through Angie at /ws/admin/debug/:id
var proto=location.protocol==='https:'?'wss:':'ws:';
ws=new WebSocket(proto+'//'+location.host+'/ws/admin/debug/${id}');
ws=new WebSocket(proto+'//'+location.host+'/admin/ws/debug/${id}');
ws.onmessage=function(e){
try{var m=JSON.parse(e.data);
if(m.type==='journal-line'){log.textContent+=m.line+'\\n';log.scrollTop=log.scrollHeight;}
@ -1794,7 +1794,7 @@ export function registerAdminRoutes(app: H3, deps: AdminDeps): void {
var ws;
function connect(){
var proto=location.protocol==='https:'?'wss:':'ws:';
ws=new WebSocket(proto+'//'+location.host+'/ws/admin/debug/${id}');
ws=new WebSocket(proto+'//'+location.host+'/admin/ws/debug/${id}');
ws.onopen=function(){status.textContent='Connected (not authed)';};
ws.onmessage=function(e){
try{var m=JSON.parse(e.data);