What block is called?

Hello,

This is a newbie question that I posted in General Discussion since a Help section isn’t available.

After enabling HTTPS on this home server, I’d like to add support for IPv6.

For some reason, with the following configuration, calling HTTPS with the IPv6 address seems to point to the block indicated (the actual site is shown), with Chrome saying that “the connection is insecure”, while I expected it to hit the default section (empty page).

I know a user is very unlikely to call the server through either its IPv4 or IPv6 address, but I’m still curious to know what’s happening.

Thank you.

~# cat /etc/nginx/sites-available/default
#DEFAULT
server {
listen 80 default_server;
listen [::]:80 default_server;

root /var/www/html;

index index.html index.htm index.nginx-debian.html;

server_name _;

location / {
	try_files $uri $uri/ =404;
}

}

#ACTUAL SITE
server {
root /usr/share/nginx/acme;
index index.html index.htm;
server_name www.acme.com acme.com;

error_page 404 /404.html;

#Add to allow IPv6
listen          [::]:443 ssl;

listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/www.acme.com/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/www.acme.com/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot

}

#80 → 443
server {
return 301 https://$host$request_uri;

server_name www.acme.com acme.com;
listen 80;
#Add to allow IPv6
listen          [::]:80;
}

As that one has

listen          [::]:443 ssl;

with Chrome saying that “the connection is insecure”,

Due to the TLS certificate not matching against the IP address, the certificate likely just contains the hostnames.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.