Let's Encrypt renewing error for Nginx module - resolved with new webmin update

Hi Folks,

I now discovered a problem with SSL renewing with a bit specific nginx that used to work like 2 months ago.

When I try to renewing SSL following error displays

Failed to request certificate : virtualmin-nginx::feature_list_web_redirects failed : Can’t use an undefined value as an ARRAY reference at /usr/libexec/webmin/virtualmin-nginx/virtual_feature.pl line 1550.

As I said I have 2 lines added in nginx for that domain that force redirection to https and www

if ($http_host ~* “^(?!www.).*$”) {return 301 https://www.$http_host$request_uri;}
if ($scheme = http) {return 301 https://$host$request_uri;}

at the very begging nginx config for that domain after

server {

and before

server_name domain.net www.domain.net;

so it looks like

server {
   if ($http_host ~* "^(?!www\.).*$") {return 301 https://www.$http_host$request_uri;}
   if ($scheme = http) {return 301 https://$host$request_uri;}
	server_name domain.net www.domian.net;

all other config values are default provide by Virtualmin nginx module.

When I comment out both lines

   if ($http_host ~* "^(?!www\.).*$") {return 301 https://www.$http_host$request_uri;}
   if ($scheme = http) {return 301 https://$host$request_uri;}

I can renew Let’s Encrypt SSL, problem is it will not work with these redirections. And it used to work like 2 months ago when I forced https/www redirection.

Any of you have an idea what went wrong or give me recommendation for better redirection.

Just to add server config:

Operating system CentOS Linux 7.8.2003
Perl version 5.016003
Path to Perl /usr/bin/perl
BIND version 9.9
Postfix version 2.10.1
Mail injection command /usr/lib/sendmail -t
Logrotate version 3.8.6
MySQL version 10.3.23
ProFTPD version 1.35
SpamAssassin version 3.4.0
ClamAV version 0.102.3

Nginx version 1.16.1
|Webmin version|1.942|
Usermin version|1.791|
Virtualmin version|6.09|

all up to date

Thank you in advance

Hi just installed today new webmin/virtualmin update and it seems now work all ok tried renewing SSL all went smooth.

Thank you for prompt update

Today yum update

virtualmin-config.noarch 0:6.0.28-1 wbm-ruby-gems.noarch 2:1.6-1 wbm-virtual-server.noarch 3:6.10-1
wbm-virtualmin-awstats.noarch 2:5.8-1 wbm-virtualmin-dav.noarch 2:3.10-1 wbm-virtualmin-git.noarch 0:1.10-1
wbm-virtualmin-htpasswd.noarch 2:2.8-1 wbm-virtualmin-init.noarch 2:2.7-1 wbm-virtualmin-nginx.noarch 0:2.8-1
wbm-virtualmin-nginx-ssl.noarch 0:1.8-1 wbm-virtualmin-registrar.noarch 2:2.7-1 wbm-virtualmin-slavedns.noarch 2:1.10-1
wbm-virtualmin-sqlite.noarch 0:1.8-1 webmin.noarch 0:1.953-1

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.