The right way to set Webmin redirect from http to https

Web Hosting

SSL certificate on the internet site enables guests to securely access.

In other words, by typing domain.com in a net-browser, a user must redirect to https://domain.com securely.

Web Hosting

For this, there is an sophisticated function in Webmin to redirect HTTP to HTTPS by default.

At Bobcares, we typically get requests from our prospects to set up “Webmin redirect HTTP to HTTPS” as element of our Server Management Solutions.

Nowadays, we’ll see how our Help Engineers configure redirection in Webmin and repair the leading 2 widespread challenges.

&nbsp

How we redirect HTTP to HTTPS in Webmin

To redirect the non-SSL internet site to SSL internet site becomes rather quick with the sophisticated function in Webmin manage panel.

Let’s take a closer appear at how we configure redirection to HTTPS in Webmin.

1. Very first, we logged into Webmin panel.

2. Subsequent, go to Webmin > Webmin Configuration > SSL Encryption .

3. Then, chosen Redirect non-SSL requests to SSL mode? to Yes.

4. Just after that, we go to Virtualmin > Program Settings > Virtualmin Configuration.

5. And in the SSL settings column, we chosen Yes on the Redirect HTTP to HTTPS by default?.

6. Lastly, saved the file.

Now, the customers could automatically access the URL devoid of typing http or https in front of the URL.

&nbsp

The leading 2 widespread difficulties following setting redirection to HTTPS in Webmin

Even following setting HTTPS redirection appropriately, we typically see errors.

Let’s see the leading 2 widespread errors and how our Help Engineers fixed it.

&nbsp

1. Incorrect .htaccess rule in Apache

Lately, 1 of our prospects reported that following setting the redirection and when he attempted to access the Webmin URL, it doesn’t appear to function appropriately. Also, he talked about that he was employing the Apache net server.

So, to repair the dilemma we took the following methods.

1. Very first, we logged into Webmin.

2. And we navigated to Virtualmin section.

3. Then we positioned Configure Sites below Solutions.

4. Subsequent, we clicked Edit Directives and looked for RewriteEngine On.

5. Then below RewriteEngine On we pasted the rule like

RewriteRule ^/(.*) https://%{HTTP_HOST}/$1 [R]

6. Lastly, we restarted apache to save the adjustments created.

/and so on/init.d/apache2 restart

Now, the user could automatically access the URL devoid of any failure.

&nbsp

2. Poor settings in Nginx configuration file

Likewise, a further buyer approached us with the dilemma following redirection in Webmin has set and when he attempted to access the URL it resulted in an error like this

This error commonly arises when you do not appropriately configure Nginx settings to manage each HTTP and HTTPS requests.

So, to resolve this error we performed the following methods.

1. Very first, we opened the Nginx configuration file in vi editor.

vi /and so on/nginx/conf.d/default.conf

2. And then we added the following line of codes to the file.

server {
listen 80
server_name  www.instance.com x.x.x.x
return 301 https://$server_name$request_uri}

3. Lastly, we restarted the Nginx service.

systemctl restart nginx

Now, the user could access Webmin and he no much more gets an error like “400 Poor Request: The plain HTTP request was sent to HTTPS port”.

That’s how we fixed the dilemma.

[Having trouble with Webmin redirect HTTP to HTTPS? We’;ll fix it for you.]

&nbsp

Conclusion

To be much more precise, for safe internet sites there is an sophisticated function in Webmin to redirect HTTP to HTTPS by default. Nowadays, we saw the leading 2 widespread challenges connected to Webmin redirection and how our Help Engineers fixed them.

The post The correct way to set Webmin redirect from http to https appeared initially on Bobcares.