Nginx does not restart when working with ssl

Hello.

I noticed a problem that when issuing a ssl certificate, nginx does not restart. The scripts contain a command to restart it. Therefore, the certificate is not issued and does not pass verification.

The panel version is 1.9 beta1
What can you suggest about this? The debug did not give anything.

I also noticed that when I check the HTTPS redirect box, the redirect does not turn on. Until I restart nginx myself - service nginx restart

Who knows what the problem might be?

When requesting a certificate, .well-known/acme-challenge is created

But after that, nginx does not restart. Therefore, this value is not applied and the certificate cannot be issued. How can this problem be solved?

@eris

v-restart-service nginx - Doesn’t restart nginx at all

But v-restart-service apache2 works fine

nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful

I don’t understand what’s wrong and where the problem is.

I’ve already racked my brains… I can’t understand why this is so

            if [ -z "$mail" ]; then
                    if [ "$WEB_SYSTEM" = 'nginx' ] || [ "$PROXY_SYSTEM" = 'nginx' ]; then
                            conf="$HOMEDIR/$user/conf/web/$domain/nginx.conf_letsencrypt"
                            sconf="$HOMEDIR/$user/conf/web/$domain/nginx.ssl.conf_letsencrypt"
                            echo 'location ~ "^/\.well-known/acme-challenge/([-_A-Za-z0-9]+)$" {' \
                                    > $conf
                            echo '    default_type text/plain;' >> $conf
                            echo '    return 200 "$1.'$THUMB'";' >> $conf
                            echo '}' >> $conf
                            if [ ! -e "$sconf" ]; then
                                    ln -s "$conf" "$sconf"
                            fi
                            if [ -n "$PROXY_SYSTEM" ]; then
                                    $BIN/v-restart-proxy
                                    check_result $? "Proxy restart failed" > /dev/null
                            fi
                    else

It seems that everything is in v-add-letsencrypt-domain

But for some reason v-restart-proxy nginx does not work

This is visible from the service uptime via the panel. If you restart manually, everything is fine. Uptime is 0 right away

Can anyone help me? I don’t know what to do anymore.

I solved the problem. The same bug in version 1.8.12

Commented out the parameter in v-restart-service:

           systemctl reload-or-restart "$service" >> $log 2>&1
   else

And the certificate began to be issued correctly right away. The https redirect was also installed.

Dear developers, Please pay attention to this bug.
nginx version: nginx/1.27.3
Debian 12
1.9-beta1 or 1.8.2

systemctl --version
systemd 252 (252.31-1~deb12u1)
+PAM +AUDIT +SELINUX +APPARMOR +IMA +SMACK +SECCOMP +GCRYPT -GNUTLS +OPENSSL +ACL +BLKID +CURL +ELFUTILS +FIDO2 +IDN2 -IDN +IPTC +KMOD +LIBCRYPTSETUP +LIBFDISK +PCRE2 -PWQUALITY +P11KIT +QRENCODE +TPM2 +BZIP2 +LZ4 +XZ +ZLIB +ZSTD -BPF_FRAMEWORK -XKBCOMMON +UTMP +SYSVINIT default-hierarchy=unified

It doesn’t need to restart as we run:

service nginx upgrade

But this doesn’t replay the redirects,…

For some reason the panel doesn’t do this.

I have seen it before where the max open files limits caused Nginx not reloading properly. Wonder if this is the case here…

But the thing is that there are no errors. When I did what I wrote, everything worked fine. I think it’s a bug. You need to change the code.

That is why I think it happens >> $log 2>&1 mutes any output

You can test it yourself. I noticed this bug on all servers. Even in version 1.8.12

There are many problems. But as far as I understand, no one wants to fix them)