Terminal doesn't load, stuck on "connecting"

SYSTEM INFORMATION
OS type and version Debian 12
Virtualmin version 2.303

Hi everyone,

For a pretty long time now (6 months I would say) the terminal tool isn’t working.
When I try to open the terminal console it is stuck in “Connecting…” state and within the Terminal tool page, it is only a black screen without error.

The only error I get from my Firefox Console is :

Uncaught DOMException: The operation is insecure.
    a https://mysite.domain.com/webmin/unauthenticated/js/bundle.min.js?233000009999999999:177
    setInterval handler*i/</< https://mysite.domain.com/webmin/unauthenticated/js/bundle.min.js?233000009999999999:177
    processCallbacks https://mysite.domain.com/webmin/unauthenticated/js/bundle.min.js?233000009999999999:177
    each https://mysite.domain.com/webmin/unauthenticated/js/bundle.min.js?233000009999999999:2
    processCallbacks https://mysite.domain.com/webmin/unauthenticated/js/bundle.min.js?233000009999999999:177
    execute_load https://mysite.domain.com/webmin/unauthenticated/js/bundle.min.js?233000009999999999:177
    c https://mysite.domain.com/webmin/unauthenticated/js/bundle.min.js?233000009999999999:2
    fireWith https://mysite.domain.com/webmin/unauthenticated/js/bundle.min.js?233000009999999999:2
    S https://mysite.domain.com/webmin/unauthenticated/js/bundle.min.js?233000009999999999:2
    n https://mysite.domain.com/webmin/unauthenticated/js/bundle.min.js?233000009999999999:2
    send https://mysite.domain.com/webmin/unauthenticated/js/bundle.min.js?233000009999999999:2
    ajax https://mysite.domain.com/webmin/unauthenticated/js/bundle.min.js?233000009999999999:2
    t https://mysite.domain.com/webmin/unauthenticated/js/bundle.min.js?233000009999999999:2
    getScript https://mysite.domain.com/webmin/unauthenticated/js/bundle.min.js?233000009999999999:2
    execute_load https://mysite.domain.com/webmin/unauthenticated/js/bundle.min.js?233000009999999999:177
    bundle https://mysite.domain.com/webmin/unauthenticated/js/bundle.min.js?233000009999999999:177
    i https://mysite.domain.com/webmin/unauthenticated/js/bundle.min.js?233000009999999999:177
    each https://mysite.domain.com/webmin/unauthenticated/js/bundle.min.js?233000009999999999:2
    i https://mysite.domain.com/webmin/unauthenticated/js/bundle.min.js?233000009999999999:177
    success https://mysite.domain.com/webmin/unauthenticated/js/bundle.min.js?233000009999999999:177
    c https://mysite.domain.com/webmin/unauthenticated/js/bundle.min.js?233000009999999999:2
    fireWith https://mysite.domain.com/webmin/unauthenticated/js/bundle.min.js?233000009999999999:2
    S https://mysite.domain.com/webmin/unauthenticated/js/bundle.min.js?233000009999999999:2
    n https://mysite.domain.com/webmin/unauthenticated/js/bundle.min.js?233000009999999999:2
    send https://mysite.domain.com/webmin/unauthenticated/js/bundle.min.js?233000009999999999:2
    ajax https://mysite.domain.com/webmin/unauthenticated/js/bundle.min.js?233000009999999999:2
    o https://mysite.domain.com/webmin/unauthenticated/js/bundle.min.js?233000009999999999:177
    r https://mysite.domain.com/webmin/unauthenticated/js/bundle.min.js?233000009999999999:177
    <anonymous> https://mysite.domain.com/webmin/unauthenticated/js/bundle.min.js?233000009999999999:178
    dispatch https://mysite.domain.com/webmin/unauthenticated/js/bundle.min.js?233000009999999999:2
    handle https://mysite.domain.com/webmin/unauthenticated/js/bundle.min.js?233000009999999999:2
    add https://mysite.domain.com/webmin/unauthenticated/js/bundle.min.js?233000009999999999:2
    Le https://mysite.domain.com/webmin/unauthenticated/js/bundle.min.js?233000009999999999:2
    each https://mysite.domain.com/webmin/unauthenticated/js/bundle.min.js?233000009999999999:2
    each https://mysite.domain.com/webmin/unauthenticated/js/bundle.min.js?233000009999999999:2
    Le https://mysite.domain.com/webmin/unauthenticated/js/bundle.min.js?233000009999999999:2
    on https://mysite.domain.com/webmin/unauthenticated/js/bundle.min.js?233000009999999999:2
    <anonymous> https://mysite.domain.com/webmin/unauthenticated/js/bundle.min.js?233000009999999999:178
    navigation https://mysite.domain.com/webmin/unauthenticated/js/bundle.min.js?233000009999999999:178
    <anonymous> https://mysite.domain.com/webmin/unauthenticated/js/bundle.min.js?233000009999999999:178

I have an Apache Reverse proxy with the following configuration (I followed instructions on the FAQ page) :

        [...]
	SSLProxyEngine On
         # Disables the remote server certificate checks
         # (only needed for self-signed certificates)
        SSLProxyCheckPeerCN     off
        SSLProxyCheckPeerName   off
        SSLProxyCheckPeerExpire off

         # Disable proxying for all /.well-known requests. It will
         # only be useful, if a domain has "DocumentRoot" defined
         ProxyPass /.well-known !

	<IfModule mod_rewrite.c>
		RewriteCond %{HTTP:Upgrade} websocket [NC]
		RewriteCond %{HTTP:Connection} upgrade [NC]
		RewriteRule ^/webmin/?(.*) "ws://127.0.0.1:10000/$1" [P,L]
	</IfModule>
	<IfModule mod_rewrite.c>
		<IfModule mod_proxy.c>
			ProxyRequests Off
			ProxyErrorOverride On
			<Proxy /webmin/>
				Order deny,allow
				Allow from all
			</Proxy>
			ProxyPass /webmin/ http://127.0.0.1:10000/
			ProxyPassReverse /webmin/ http://127.0.0.1:10000/
		</IfModule>
	</IfModule>

All of the instructions are followed :

  • /etc/webmin/config:
referers=mysite.domain.com
webprefix=/webmin
webprefixnoredir=1
  • /etc/webmin/miniserv.conf :
redirect_prefix=/webmin
cookiepath=/webmin
  • /etc/webmin/xterm/config :
host=mysite.domain.com/webmin
  • Apache modules :
a2query -m | egrep 'proxy(\ |_ws)'
proxy (enabled by site administrator)
proxy_wstunnel (enabled by site administrator)

I have no warning/error log either on apache or webmin.

Could you help me resolve the issue please ?

Cheers

that is a pretty long time to wait (I assume the website is still working and your certs are up-to-date for all those https: requests) - I am just guessing here but using a reverse proxy might be the issue. (it’s been years since I touched Apache :man_shrugging: )

you are talking about the terminal option in webmin and/or virtualmin ? If so this uses websockets to make the terminal connection, given this it’s internal to miniserv so you can discard apache or if somebody reads this in the future you can also discard nginx

I don’t think the Terminal is expected to work through a proxy (maybe likewise for realtime stats). I don’t recall anyone reporting success making it work, anyway, and I haven’t tried.

This was working before using Apache Reverse proxy…
Anyone could help me please ?

OK, I found the settings to make it work.
From my first post, I needed to change these files like this :

  • /etc/webmin/xterm/config
host=mysite.domain.com
  • /etc/webmin/miniserv.conf
websocket_host=wss://mysite.domain.com

Now the Terminal tool is working as expected.

1 Like

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.