| OS type and version | Ubuntu 22.04
| Webmin version | 1.994
| Virtualmin version | 7.1-1
HTTPS redirect was working in the previous version, but I did a fresh install of Ubuntu 22.04 and Virtualmin 7 and I find that HTTPS redirect is not working.
The setting is located here:
Webmin>Webmin Configuration>SSL Encryption>SSL Settings Redirect non-SSL requests to SSL mode?>toggle to yes
According to the logs, this sets the ssl_redirect variable in miniserv.conf to 1.
Alternatively, I can add a directive in Apache settings to accomplish a redirect:
“Redirect permanent / https://example.net/”
It’s not perfect, because this is not a global directive, and it is per-site only.
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
in .htaccess. There are other ways, of course.
The original advantage was that during the transition from when most pages of most sites weren’t encrypted, to the present situation where everything is expected to be encrypted, it was one snippet of code I could quickly paste into any site to accomplish that. Nowadays it’s just habit.
I don’t actually know what you’re talking about here. It sounds like you’re trying to have a site in Apache (presumably a Virtualmin managed site) redirected to SSL when the user connects on HTTP instead.
But, all of the settings you’re talking about are Webmin settings, and have nothing to do with Apache or Virtualmin.
This configures the Webmin web server (which is not Apache and is not what serves your Virtualmin sites).
This would be completely unrelated to the Webmin settings you’re talking about, and would effect Apache sites. Virtualmin has an option for this on a per-domain basis, but it’s not the one you’re asking about above.
Configures the Webmin web server (not Apache, and not your Virtualmin-managed sites) to redirect non-HTTPS requests to HTTPS.
So, what are you trying to accomplish here? Are we talking about Webmin and its web server, or are we talking about the sites that Virtualmin manages in Apache?
But, also, the Webmin settings definitely have not changed in Virtualmin 7 because they are not in the Virtualmin modules, they’re in core Webmin, and this is not an option we alter during installation (everything Virtualmin configures in Webmin can be seen in the Webmin.pm module in virtualmin-config package here: Virtualmin-Config/Webmin.pm at master · virtualmin/Virtualmin-Config · GitHub )
As you can see, we enable SSL, but do not enable ssl_redirect, and nothing much has changed in this module in virtualmin-config since it was written years ago.
No. That option is for Virtualmin managed virtual hosts (in Apache or nginx). Has nothing to do with Webmin. And, Webmin does not have a per-domain option for this; it is on or off for Webmin.
What setting? I’m still not clear what you’re trying to do! Are you trying to redirect your domains (in Apache) to HTTPS if connections come in on HTTP? Or are you trying to do that in Webmin?
To clarify please: I am trying to do redirect my domains in Apache. It is working for me now. However, I am requesting that you please tell me what is the mechanism which virtualmin employs to effect this?