-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HTTPS Redirect not working on Nginx #6
Comments
Doesn't this only work if you have a separate Unfortunately Virtualmin currently only uses a single |
I have recently run into a similiar issue, where we needed to redirect www. to non-www. Nginx expects something similar to this to deal with this scenario:
|
The latest version of Virtualmin does support different redirects for HTTP and HTTPS, which you can create in the UI. |
I did try and use the UI to create this The above errors with:
Which makes sense of course, as this form is for a redirect based upon the source path relative to the virtual server domain. |
The source URL path should be just |
Are you sure there's not a space at the start or end of the path? |
Hmm, this is very confusing. Can you check which version of Virtualmin and the Nginx plugin you're running there? |
|
We just released Webmin 2.100 - try upgrading and see if that helps. |
Not sure, Jamie suggested trying 2.101 I tried with a sub directory too (so https://www.example.com/test) and I get the same error. |
Please look at my screenshot above for reference. |
This is related to redirecting www.example.com to example.com So do we not need to use the second option, 'URL at this website'? |
Nginx really wants two server blocks to handle the www -> non-www redirect: https://www.nginx.com/resources/wiki/start/topics/tutorials/config_pitfalls/#server-name-if |
I am using LEMP stack with Virtualmin 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
UPDATE: I created this thread back in 2018 where I used virtualmin briefly when I was testing it out. I never really used virtualmin to it's extent.
I can't believe this is still an issue after 5 years. I have been receiving notifications about it, so I came here to update this thread and unsubscribe from it, as I can't really figure out how to delete this thread.
The text was updated successfully, but these errors were encountered: