Welcome! Log In Create A New Profile

Advanced

ssl config magic???

Posted by limi7less 
ssl config magic???
March 14, 2012 06:13PM
Hey everybody

im very curious as to why this works:

server {
listen 111.111.111.111:443 default_server ssl;
ssl_certificate /usr/share/nginx/sites/example.com/ssl/crt;
ssl_certificate_key /usr/share/nginx/sites/dexample.com/ssl/key;
return 404;
}
server {
listen 80;
listen 111.111.111.111:443;
server_name example.com;
root /usr/share/nginx/sites/example.com/webroot
}

if i access https://example.com it opens the index file in the webroot folder... if i access https://111.111.111.111 it returns a 404 error (after the obvious certificate error)... so it actually works as intended... the big question is why???

shouldnt a request to https://example.com also return a 404 since the first server block gets chosen because its default?

i dont even have to add ssl_certificate to the second server block, why is that ?

i appreciate ur answers, thanks a lot...
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 192
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready