OS type and version Ubuntu 20.04.4
Webmin version 1.994
Virtualmin version 7.1-1
Related packages N/A
After the latest virtualmin-nginx update (webmin-virtualmin-nginx), the following error keeps popping up whenever I try to make certain nginx-related changes (like auto-redirect http to https via Server Configuration → Website Options):
configuration is invalid : nginx: [emerg] invalid condition ""$scheme"" in /etc/nginx/sites-enabled/example.com.conf:59 nginx: configuration file /etc/nginx/nginx.conf test failed
I ended up removing the above snippet from the sites-available (not sites-enabled) conf file and nginx is working fine again but re-enabling “Redirect all requests to SSL site” creates the above snippet again and the error comes back. Previously created virtual servers didn’t have the above snippet when enabling “Redirect all requests to SSL site” so I’m not sure what’s going on.
The above snippet is generated whenever I try to enable Server Configuration → Website Options->Redirect all requests to SSL site. I am not sure if it’s something I added or if it’s related to the new update but I’ll try setting up Virtualmin with default config on a fresh server later this week and see if I can replicate this.
Same problem here. The latest webmin-virtualmin-nginx will be auto added around quotes to parameters on Nginx conf. Please check and fix it, thanks so much!
I am using Adding Nginx config directives in Server Templates > Plugin options to add aditional nginx config to every Virtual server when it’s created. My aditional nginx config not have any double quotes, but when a Virtual Server was created, my aditional nginx config in /etc/nginx/sites-available/domain-xxx.conf has auto added double quotes around all parameters.
Eg:
My original aditional nginx config:
if ($server_port !~ 443){
rewrite ^(/.*)$ https://$host$1 permanent;
}
When a Virtual Server is created, it will auto added double quotes like this:
if ("$server_port" !~ 443){
rewrite "^(/.*)$" "https://$host$1" permanent;
}
So, Nginx alert an error, and this make SSL Renew not working too, please fix this, sir! Thanks so much! @staff
What is Virtualmin Nginx plugin version do you have installed (can be checked on System Settings ⇾ Features and Plugins page or by running webmin --versions)?
I cannot yet reproduce this issue in neither described cases.