These forums are locked and archived, but all topics have been migrated to the new forum. You can search for this topic on the new forum: Search for Proper way to require SSL on a virtual server? on the new forum.
I am looking for the option to require SSL on a virtual server website. I see the option to require a client cert, but not one to require SSL on the server side. I assume I could change the apache port for that virtual server but that seems to be the wrong way to do it. I have not been able to find any info on this particular issue on this forum.
on any existing server go to edit virtual server then enabled features and then choose SSL website enabled?
for new servers this can be set in the server template.
As long as it is enabled in the feature and plugins under system settings.
Yes, I know how to enable SSL. I don't know how to make it required.
This isn't easily done in Virtualmin itself at the moment... the simplest ways to do this would be to either have your application handle the redirect if it's not on the SSL port, or to use a .htaccess file, and put something like this in it:
RewriteEngine On
RewriteCond %{SERVER_PORT} !443
RewriteRule (.*) https://www.example.com/ [R]
I did it like so RewriteEngine on
RewriteCond %{HTTP_HOST} =domain.com
RewriteRule ^(.*) https://www.domain.com [R]
and put it in the virtualhost container in the httpd.conf
For the time being I did this with a simple redirect and changes to the application.