HTTPS Redirect not working on Virtualmin Nginx

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

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 domain.com.conf

server { server_name domain.com www.domain.com; listen ipaddress:80; rewrite ^/(.*) https://domain.com/$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.

Thanks

Sun, 05/20/2018 - 19:32
purewhite

I'm seeing the same behavior on Ubuntu with Nginx

Fri, 10/25/2019 - 04:21
eugenevdm.host
eugenevdm.host'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

https://vander.host WordPress Website Hosting, VPS Hosting, and Domain Registration

Topic locked