webmin apache proxy to admin.domain.tld

Hi,

I’m trying to get virtualmin to answer via apache proxy on admin.mydomain.tld, to do so I’m using an 997-admin.mydomain.tld.conf file in the /etc/apache2/sites-enabled/ directory on Ubuntu 16.

When I ask for admin.mydomain.tld I get the right login page, but as soon as I clic on the Sign In button I’m redirected on admin.mydomain.tld:10000. If I continue on this path I can login and get everything but always with :10000 which is not what I want as this port is sometime impossible to reach.
The worst is that if I clic my browser Back button, then Reload the page, I’m getting what I want, every Virtualmin pages on admin.mydomain.tld, without port 10000. That is terrible, it means from a port 10000 filtered place a user can think that he is not logged in, actually he is. If someone else comes on the machine an type admin.mydomain.tld on the browser he is directly in Virtualmin.

I tried several config combinations, changing webprefixnoredir to 1 or 0 doesn’t change anything. In /etc/webmin.config webprefix= (is empty).

Here is the 997-admin.mydomain.tld.conf file file content :

#A virtualhost to listen on port 80 and rewrite any request on https

SuexecUserGroup “#1001” “#1001
ServerName admin.mydomain.tld
ProxyPreserveHost On
ErrorLog /var/log/virtualmin/mydomain.tld_error_log
CustomLog /var/log/virtualmin/mydomain.tld_access_log combined
RewriteEngine on
RewriteCond %{HTTP_HOST} =admin.mydomain.tld
RewriteRule ^(.*) https://admin.mydomain.tld/ [R]

The proxy virtualhost

SuexecUserGroup "#1001" "#1001" ServerName admin.mydomain.tld SSLProxyEngine on SSLProxyVerify none SSLProxyCheckPeerCN off SSLProxyCheckPeerName off SSLProxyCheckPeerExpire off SSLEngine on SSLProxyEngine on ProxyPreserveHost On Order allow,deny Allow from all ProxyPass / https://localhost:10000/ ProxyPassReverse / https://localhost:10000/ ProxyRequests on RewriteEngine on RewriteRule ^$ https://%{HTTP_HOST}/ [L,R=301] ErrorLog /var/log/virtualmin/mydomain.tld_error_log CustomLog /var/log/virtualmin/mydomain.tld_access_log combined DirectoryIndex index.html index.htm index.php index.php4 index.php5 RemoveHandler .php RemoveHandler .php7.0 FcgidMaxRequestLen 1073741824 SSLCertificateFile /etc/letsencrypt/live/mydomain.tld/fullchain.pem SSLCertificateKeyFile /etc/letsencrypt/live/mydomain.tld/privkey.pem SSLCACertificateFile /home/mydomain/ssl.ca SSLProtocol all -SSLv2 -SSLv3 -TLSv1 -TLSv1.1

If anyone knows why after Sign In I’m getting a :10000 URI in my browser that would help.

Thanks for reading.

Regards
V.

Hello, this work for me, but your have disable post config, the apache home page in http or redirect again.

https://www.digitalocean.com/community/tutorials/how-to-install-webmin-on-ubuntu-18-04