# SNI host with non SSL wrong cert

**URL:** <https://www.ruby-forum.com/t/sni-host-with-non-ssl-wrong-cert/244160>\
**Category:** NGINX\
**Created:** [February 29, 2016, 11:42am UTC](https://www.ruby-forum.com/t/sni-host-with-non-ssl-wrong-cert/244160 "2016-02-29T11:42:08Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sadaf\_N](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/858c86/32.png) [@Sadaf\_N](https://www.ruby-forum.com/u/Sadaf_N)\
**Post date:** [February 29, 2016, 11:42am UTC](https://www.ruby-forum.com/t/sni-host-with-non-ssl-wrong-cert/244160/1 "2016-02-29T11:42:08Z")

</div>

Hello,

I have nginx installed with multiple domainnames and multiple ssl-hosts  
use SNI.  
Now I add an other vhost with non-ssl server entry like [example.com](http://example.com).  
when I try to use [https://example.com/](https://example.com/) I get a cert from an other vhost.

I found this “solution” to “catch all”  
|  
|

|server { listen 443 ssl; server\_name \_; ssl on; ssl\_certificate  
/path/to/certificate.crt; ssl\_certificate\_key /path/to/certificate.key;  
return 444; }|

|But I need a valid cert to get no error in browsser.  
Also when I try to redirect it to non-ssl area.

Is there a solution without need a cert?

somethink like

||server {  
listen 443;  
server\_name [ssl.example.com](http://ssl.example.com);  
break;  
}|
