HTTPS Redirect not working on Virtualmin Nginx

3 posts / 0 new
Last post
#1 Wed, 04/11/2018 - 11:28

HTTPS Redirect not working on Virtualmin Nginx

I am using LEMP stack with Virtual which I installed using "--bundle LEMP" while installing virtualmin on a debian9 OS.

When I below settings, The https redirect is not working on any of the domains.

System Settings --> Virtualmin Configurations --> SSL Settings --> Redirect all http to https by default --> yes

However I am able to do the redirect by adding below code in

server { server_name; listen ipaddress:80; rewrite ^/(.*)$1 permanent; }

But I wonder why the inbuilt feature that ships with virtualmin is not working?

Please note I am using Lets' Encrypt SSL.

on other note I wonder what type of Redirect Virtualmin does if that feature is to work? Is it also 301 redirect?

Any help on this would be immensely helpful.


Sun, 05/20/2018 - 19:32

I'm seeing the same behavior on Ubuntu with Nginx

Fri, 10/25/2019 - 04:21's picture

I personally don't think that setting works if you're using NGINX.

My favourite for redirection is this block

if ($scheme = http) { return 301 https://$host$request_uri; }

but I don't want to do it in config files, because I do it in mass for WordPress and basically every other site. Would prefer a UI or more consistent method.

Eugene van der Merwe WordPress Website Hosting, VPS Hosting, and Domain Registration

Topic locked