0

I have Webmin working on a domain with an SSL certificate. However, when I visit it over HTTP, it redirects to https://hostname:10000 instead of the domain name.

I've set the FQDN in /etc/hosts (because I can't find any other way to do it - can't find anything on this mysterious "systemd-resolved" to edit my resolv.conf file, and all the online guides say "use resolvconf" which I don't even have) like so:

127.0.1.1 hostname.example.com hostname

(it was 127.0.1.1 before, not 127.0.0.1)

hostname returns my hostname, hostname --domain returns my domain, and hostname -f returns the FQDN that I have set.

But Webmin doesn't care. Webmin wants to be special. Webmin decides to assume that my hostname is my domain name, and redirect to that instead. How do I fix this?

Some sites say I should edit the Webmin source code, but that would get reverted as soon as I update, and is also kind of not the best solution in general.

Dev
  • 103
  • 7
  • Webmin most likely uses the setting for the "web server hostname" in Webmin itself - see the screenshot on https://doxfer.webmin.com/Webmin/Webmin_Configuration#Ports_and_Addresses - you might want to changea short hostname there to a specific FQDN if that is what you are using (or maybe use "work out from browser~" ) – Bob Jul 22 '20 at 18:37
  • 1
    It's Ubuntu that wants to be special. It inherited this goofy hostname behavior from Debian, and Webmin is the innocent victim. (As are several other services which rely on the hostname being the FQDN.) There should be some configuration option in Webmin to override the hostname, but most people here don't use Webmin, so you might not get an answer. – Michael Hampton Jul 22 '20 at 18:51
  • @HermanB Your comment solved my problem! Please make it an answer so I can accept it :D – Dev Jul 22 '20 at 20:18

1 Answers1

2

Webmin most likely uses a setting called the "web server hostname" in Webmin itself to generate URI’s (see the screenshot on https://doxfer.webmin.com/Webmin/Webmin_Configuration#Ports_and_Addresses)

You might want to change the short hostname there to a specific FQDN if that is what is configured , or maybe use the "work out from browser” alternative.

Bob
  • 5,805
  • 7
  • 25