diff --git a/ui/src/app/applications/components/pod-terminal-viewer/pod-terminal-viewer.tsx b/ui/src/app/applications/components/pod-terminal-viewer/pod-terminal-viewer.tsx index 5d29777b563b..b4d4b423da99 100644 --- a/ui/src/app/applications/components/pod-terminal-viewer/pod-terminal-viewer.tsx +++ b/ui/src/app/applications/components/pod-terminal-viewer/pod-terminal-viewer.tsx @@ -141,8 +141,9 @@ export const PodTerminalViewer: React.FC = ({selectedNod function setupConnection() { const {name = '', namespace = ''} = selectedNode || {}; + const url = `${location.host}${appContext.baseHref}`.replace(/\/$/, ''); webSocket = new WebSocket( - `${location.protocol === 'https:' ? 'wss' : 'ws'}://${location.host}/terminal?pod=${name}&container=${AppUtils.getContainerName( + `${location.protocol === 'https:' ? 'wss' : 'ws'}://${url}/terminal?pod=${name}&container=${AppUtils.getContainerName( podState, activeContainer )}&appName=${applicationName}&projectName=${projectName}&namespace=${namespace}`