manoaratefy / ispconfig3-varnish

This ISPConfig 3 plugin implements Varnish as reverse proxy, NGINX as SSL Termination and Apache as backend.
MIT License
10 stars 4 forks source link

delete conf if ssl fail #4

Open Maurotb opened 3 years ago

Maurotb commented 3 years ago

Hi, i have a problem, i create an ssl certificate with ispconfig and let'sencrypt for site test.it All work Now i change domain name to test.bad , let's encrypt can't issue a certificare, ispconfig can't create http config for apache but this script create a ssl config for nginx with a bad certificate file. At this point, if i restart nginix, it not start.

Solved with this

        **if (!file_exists($crt_file) ||  !file_exists($crt_file)){
            $app->log('Cert files not found: remove from nnginx', LOGLEVEL_DEBUG);
            $this->vhost_helper('delete', $data, $tpl->grab());
        }else{**
                    if ($this->action == 'insert')
                            $this->vhost_helper('insert', $data, $tpl->grab());

                    if ($this->action == 'update')
                            $vhost_backup = $this->vhost_helper('update', $data, $tpl->grab());
            **}**

Another problem, if i delete an subdomain, it stay in nginx config, not removed. If i add an alias domain, nginx config is not modify