Problem with to multiple virtual hosts

auto nginx-forum at forum.nginx.org
Tue May 8 05:46:07 UTC 2018


We use nginx for Hosting multiple hosts. We have haves mixes, some sites are
only available at http:// and other sites are available with https://

We create a new config-file for every virtual hosts (domain) if there is a
new customer with a new Homepage. All works correctly.

Today we create 2 new config-files on the nginx, copy the file to
sites-enabled and make a nginx reload.

Now, no sites works again. But there was no error after the nginx reload.

In the Browser we get the error that the Site is not available. And we get
this error at all Sites.

In the nginx error.log we get the message *2948... no "ssl_certificate" is
defined in server listening on SSL port while SSL handshaking, client:
178...., server 0.0.0.0:443

In the Log-Files are many of these messages, i think ~20 lines of this.

The Virtual-Host config File we create look like:

server {
   listen 80;
   server_name example.de;
   return 301 http://www.$http_host$request_uri;
}
server {
   listen 80;
   server_name *.example.de;
   location / {
      access_log off;
      proxy_pass http://example.test.de;
      proxy_set_header X-Real-IP $remote_addr;
      proxy_set_header X-Forwareded-For $proxy_add_x_forwarded_for;
      proxy_http_version 1.1;
      proxy_set_header Upgrade $http_upgrade;
      proxy_sestheader Connection "upgrade";
   }
}

We get the error only if we create a new virtual-host file in the
sites-enabled. if we copy the code into a exisiting virtual host file it
works correctly and all other sites works again.

Any Ideas why it doesn't work if we create a new file? We deleted the new
file, create it again but always get the same effect with the error Message
in the error-log file.

I don't know if its important but we have 196 Files in the sites-enabled
directory. If we create a new one the error come again, if we delete the
file and write (copy&paste) the same code into a existing file, it works
correctly?!

We don't think that is a ssl error, we think that the count of files are the
problem?!

We want to create always a new virtual-host config-file for each customer
and don't edit add the config to a existing file.

Posted at Nginx Forum: https://forum.nginx.org/read.php?2,279708,279708#msg-279708



More information about the nginx mailing list